home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
PERL4036.ZIP
/
os2
/
alarm.pl
next >
Wrap
Text File
|
1993-02-08
|
353b
|
18 lines
sub handler {
local($sig) = @_;
print "Caught a SIG$sig -- shutting down\n";
exit(0);
}
$SIG{'ALRM'} = 'handler';
$SIG{'INT'} = 'handler'; # Ctrl-C pressed
$SIG{'BREAK'} = 'handler'; # Ctrl-Break pressed
$SIG{'TERM'} = 'handler'; # Killed by another process
print "Starting execution ...\n";
alarm(10);
while ( <> ) {
}
print "Normal exit.\n";