in reply to Re: Reading from a pipe line by line
in thread Reading from a pipe line by line

Hi,

-s $handle does not seem to work on Linux, it returns 0. So I modified the code to:
my $ios = IO::Select->new($child); if ($ios->can_read(0)) { if (sysread($child, my $data, 1024)) { my @lines = split(/\n/, $data); print "Read message(s): ".join("|", @lines); } else { # Child died print "Child died"; } }
Cheers!