U want to set an alarm() so the program can signal itself after 10 secods.
I'll just quote O'Reilly:
$SIG{ALRM} = \&timed_out;
eval {
alarm (10);
$buf = <>;
alarm(0); # Cancel the pending alarm if user responds.
};
if ($@ =~ /GOT TIRED OF WAITING/) {
print "Timed out. Proceeding with default\n";
#....
}
sub timed_out {
die "GOT TIRED OF WAITING";
}
--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"
00000100
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs