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


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

I think I finally have a clean solution. After much reading and asking around in the office someone helped me with this snippet, assuming TAIL is the file handle you're doing the tail -f on. The answer is to simply redo the failed operation which previous responses had suggested. So if anyone is interested this is what I've settled on and particularly like it because it's short and straightforward:

while (1) { while(1) { my $line = <TAIL>; if (!defined($line)) { redo if $! eq 'Interrupted system call'; last; } print $line; } printf "Fell through...\n"; }

-mark

Replies are listed 'Best First'.
Re^6: Different perl behavior between V5.10 and V5.14
by vsespb (Chaplain) on Apr 01, 2013 at 18:03 UTC
    Yep, looks like a good workaround. Also I belive you can use
    $!{EINTR}
    instead of
    $! eq 'Interrupted system call'
    (as per '%!' in perlvar)