Windows doesn't have signals
No, but it simulates some of them:
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>;
sleep 10;
};
alarm 0;
if ($@ =~ /timeout/) {
print "You timed out.\n";
}
__END__
[ 7:18:01.22] C:\test>alarmit.pl
Enter your password: You timed out.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.