S
Swarna
When I execute test1.pl, test2.pl is blocking.
Any ideas as to why the sysread is not returning immediately.
Thanks
Swarna
########## test1.pl #########
#!perl
open (FD, "|-", "perl test2.pl");
sleep (100);
########### test2.pl ##########
#!perl
my $buffer;
while (1) {
print STDERR "before sysread \n";
$bytes = sysread(STDIN, $buffer, 524288) || last;
die "undef bytes \n" unless defined $bytes;
print STDERR "after sysread \n";
}
print STDERR "last statement\n";
Any ideas as to why the sysread is not returning immediately.
Thanks
Swarna
########## test1.pl #########
#!perl
open (FD, "|-", "perl test2.pl");
sleep (100);
########### test2.pl ##########
#!perl
my $buffer;
while (1) {
print STDERR "before sysread \n";
$bytes = sysread(STDIN, $buffer, 524288) || last;
die "undef bytes \n" unless defined $bytes;
print STDERR "after sysread \n";
}
print STDERR "last statement\n";