develooper Front page | perl.perl6.users | Postings from August 2022

Re: something between run and qx() ?

Thread Previous | Thread Next
Marc Chantreux
August 4, 2022 12:39
Re: something between run and qx() ?
Message ID:
hello Liz and thanks for helping,

> I believe you could use App::Rak for that: 
>     $ zef install App::Rak

I'll test rak at some point but in this case, I can just write

	dpkg-query -f \${db-fsys:Files} -W gnuplot\* |
	raku -pe '.=trim; .say if .trim.IO.f'

I asked the question about qx() and run because because I still have
the "removing bash with raku" in mind and this is typically the kind
of things where both tools comes with flaws.

It would be nice to define a backtrick operator (like in rc) so we
could write

	my @installed-files =
		grep *.IO.f,
		map *.trim,
		`< dpkg-query -f ${db-fsys:Files} -W gnuplot* >;

insead of

	my @installed-files =
	grep *.IO.f,
	map *.trim,
	( run :out, < dpkg-query -f ${db-fsys:Files} -W gnuplot* > ).out.lines;


Marc Chantreux
Pôle de Calcul et Services Avancés à la Recherche (CESAR)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About