in reply to Time-limited input on STDIN
James.#!/usr/bin/perl use strict; use warnings; my $text; print "Prompt: "; alarm(10); eval { local $SIG{ALRM} = sub { die }; $text = <STDIN>; }; print "done accepting text\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Time-limited input on STDIN
by bobn (Chaplain) on Aug 08, 2003 at 22:42 UTC | |
Re: Re: Time-limited input on STDIN
by ajdelore (Pilgrim) on Aug 11, 2003 at 17:58 UTC |