4 ms·
> pipes In Perl you can just run commands using backticks or qx// and get their output, and so you can pipe them in any way you want: my @a = map { chomp;
by qalmakka 3y ago
> pipes
In Perl you can just run commands using backticks or qx// and get their output, and so you can pipe them in any way you want:
my @a = map { chomp; $_ } `ls -1 | sort | uniq`
You can otherwise use `open` to spawn shells as if they were files, piping either on their left or right:
open my $output, '-|', 'ls -1 | sort | uniq';
while (<$output>) { .. }