Hello;

  I'm trying to obtain line-by-line output from a command pipe in perl.

  Unfortunately, I am firmly held to 5.8.8 version of perl on this
specific machine :-(

  Apparently, creating an array for my command prevents me from
including the final pipe symbol when trying to use the three-argument
form of open when using an array for my command rather than a scalar.

code snippet #1:
my @cmd = ("make", "target_name", "2>&1");
open my $fh, @cmd, "|" or die "blah: $!\n"; fails, "Unknown open() mode '5'"

code snippet #2:
my @cmd = ("make", "target_name", "2>&1", "|");
open my $fh, @cmd or die "blah: $!\n"; fails, "Unknown open() mode '5'"

Is it true that for me to use command pipes for line-by-line output
that I have to abandon the list form of the open or system command and
use the scalar form?

Bottom line: I'd like to have a non-scalar form of the open and
line-by-line handling of the output of the command pipe if that is
possible.

Thanks,
Ken Wolcott

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to