Trying to run the code below in Win32, any reason why it may not be working?
Behaviour: It just sits there and doesn't time out as expected.
Cheers,
Paul ---
my $timeout = 10;
eval {
local $SIG{ALRM} = sub { die "alarm\n" };
alarm $timeout;
print "Hit ENTER key within $timeout seconds: ";
$buf = <>;
alarm 0;
};
if ($@) {
die unless $@ eq "alarm\n";
# propagate unexpected errors
# timed out
} else {
print "else\n";
}
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs