$ 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