Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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?
[choroba]: Integration testing
[stevieb]: heh, yeah, sorry. This is integration testing for certain. In fact, it's even Continuous Integration ;)
[stevieb]: Obviously, Travis CI just won't cut it for these distributions...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2017-06-25 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (572 votes). Check out past polls.