http://www.perlmonks.org?node_id=1026480


in reply to Re^2: Different perl behavior between V5.10 and V5.14
in thread Different perl behavior between V5.10 and V5.14

Hm. Weird. I've modified code like this:
#!/usr/bin/perl -w use Time::HiRes; $SIG{"ALRM"}=\&sigAlarm; my $interval=1; my $uInterval=$interval*10**6; Time::HiRes::ualarm($uInterval, $uInterval); open TAIL, "tail -f xyz|" or die 'couldnt open xyz'; while (1) { while ($line=<TAIL>) { $X = $!; print $line; } if (eof(TAIL)) { print "EOF TAIL!\n"; } print "Fell through... $!\n"; } sub sigAlarm { print "alarm\n"; }
After first EOF found, it never works normal again. It just prints EOF TAIL + Fell through... in infinite loop. So, I think filehandle never recovered after Perl finds EOF.