7stud has asked for the wisdom of the Perl Monks concerning the following question:
Can anyone tell me what is the matter with the following code? Is it a problem with the code or with Windows Vista?
use strict; use warnings; use 5.010; print 'Enter your password: '; my $password = eval { local $SIG{ALRM} = sub {die "timeout\n"}; alarm 5; return <STDIN>; }; alarm 0; if ($@ =~ /timeout/) { say "You timed out."; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: $SIG{ALRM} and windows vista?
by ikegami (Patriarch) on Jan 04, 2010 at 03:31 UTC | |
by Anonymous Monk on Jan 04, 2010 at 03:35 UTC | |
by ikegami (Patriarch) on Jan 04, 2010 at 06:39 UTC | |
by 7stud (Deacon) on Jan 04, 2010 at 05:15 UTC | |
Re: $SIG{ALRM} and windows vista?
by desemondo (Hermit) on Jan 04, 2010 at 01:57 UTC | |
by ikegami (Patriarch) on Jan 04, 2010 at 06:57 UTC | |
Re: $SIG{ALRM} and windows vista?
by BrowserUk (Patriarch) on Jan 04, 2010 at 06:16 UTC | |
by ikegami (Patriarch) on Jan 04, 2010 at 06:37 UTC | |
by BrowserUk (Patriarch) on Jan 04, 2010 at 06:56 UTC | |
by ikegami (Patriarch) on Jan 04, 2010 at 06:58 UTC | |
by BrowserUk (Patriarch) on Jan 04, 2010 at 07:18 UTC | |
| |
by ikegami (Patriarch) on Jan 04, 2010 at 07:37 UTC |