gregorovius has asked for the wisdom of the Perl Monks concerning the following question:
I want to be able to time out when reading a handle with the angle operator:
Gregorovius
Where $line would be undefined if a line is not read within the time specified, where that variable would be a perl predefined global. Day dreaming aside, what would the easiest way to accomplish this be? (and with a hi-res timer, please :-) I guess I could start by looking at signal handlers. Thanks in advance for any help.use English; $TIMEOUT_FOR_ANGLE_IO = 2.35; my $line = <STDIN>; print 'you took too long' unless defined($line);
Gregorovius
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: timeout for ?
by ar0n (Priest) on Aug 29, 2000 at 13:06 UTC | |
by tye (Sage) on Aug 29, 2000 at 18:25 UTC | |
Re: timeout for ?
by gregorovius (Friar) on Aug 29, 2000 at 21:41 UTC | |
by tye (Sage) on Aug 29, 2000 at 22:53 UTC | |
Re: timeout for ?
by ncw (Friar) on Aug 30, 2000 at 14:44 UTC |
Back to
Seekers of Perl Wisdom