in reply to awk cmd in perl
After posting the heredoc with backticks solution, I thought of another way that required no escaping.
$ cat pm_1223868_heredoc_awk_2.pl #!/usr/bin/env perl use strict; use warnings; open my $fh, '-|', q[echo "a b c" | awk '{print $2}']; print <$fh>;
$ pm_1223868_heredoc_awk_2.pl b
That's just the guts of the solution. You'll need to add error handling at least. See open for more about this.
— Ken
|
|---|