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

Re: something between run and qx() ?

Thread Previous | Thread Next
From:
Elizabeth Mattijsen
Date:
August 4, 2022 13:37
Subject:
Re: something between run and qx() ?
Message ID:
87283DE0-5CB5-4F0A-AD31-EC16879B06F6@dijkmat.nl
> On 4 Aug 2022, at 14:38, Marc Chantreux <mc@unistra.fr> wrote:
> 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;

sub prefix:<`>(*@a) { (run @a, :out).out.lines }

dd ` <ls>;
("Changes", "LICENSE", "META6.json", "README.md", "bin", "dist.ini", "lib", "releases", "resources", "run-tests", "t").Seq


Liz
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