my $path = $ARGV[0]; open my $fh, "-|", "$path 2>&1" or die "can't open $path: $!"; print ": $_" for <$fh>; # print line by line close $fh;