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

Re: something between run and qx() ?

Thread Previous | Thread Next
From:
Marc Chantreux
Date:
August 4, 2022 12:39
Subject:
Re: something between run and qx() ?
Message ID:
Yuu90Zs0ZrT3oTby@prometheus.u-strasbg.fr
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;

regards,

-- 
Marc Chantreux
Pôle de Calcul et Services Avancés à la Recherche (CESAR)
http://annuaire.unistra.fr/p/20200

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About