Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^5: Different perl behavior between V5.10 and V5.14

by markseger (Beadle)
on Apr 01, 2013 at 17:24 UTC ( #1026518=note: print w/replies, xml ) Need Help??


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)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026518]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2016-09-28 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (523 votes). Check out past polls.