in reply to how to use angle operator with timeout?
I couldn't get alarm to work for me in a consistent manner, so
I tried
Tie::Scalar::Timeout.
#!/usr/bin/perl -l use strict; use warnings; use Tie::Scalar::Timeout; tie my $line, 'Tie::Scalar::Timeout', EXPIRES => '+1s', POLICY => undef; $line = system("whoami"); while (defined($_ = $line)) { foreach $line(my @lines) { print "$_" or die $@; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to use angle operator with timeout?
by Anonymous Monk on Feb 05, 2013 at 07:50 UTC |
In Section
Seekers of Perl Wisdom