- or download this
open (COMMAND, '-|', "$Command");
while (<COMMAND>) {
...
local $SIG{ALRM} = sub { die("TimerTriggerStatus\n"); };
alarm(10);
...
- or download this
#!/usr/bin/perl
use strict;
...
};
print "eval exited with this: ".$@."\n";
}
- or download this
It is usually a mistake to intermix alarm( ) and sleep( ) calls. sleep
+( ) may be internally implemented in your system with alarm( ), which
+ will break your original alarm( )settings, since every new alarm( )
+call cancels the previous one.