Re: Odd problems with alarm()

2008-11-03 Thread Dr.Ruud
"Matthew Tice" schreef: > eval { > local $SIG{ALRM} = sub {die "alarm\n"}; > alarm 2; > $test = `ls @ARGV[0]`; > alarm 0; > }; > > if ($@) { > die unless $@ eq "alarm\n"; > # Timed out - error > exit 1; > } else { > # Okay > exit 0; > } eval { local $SIG{ALRM} = sub {die

Re: Odd problems with alarm()

2008-11-03 Thread John W. Krahn
Matthew Tice wrote: I've setup a simple (well, I copied it from someone else and modified it) to monitor stale NFS mounts. Some preliminary testing seemed to go okay but this problem crept up on me this weekend. The script is as follows: #!/usr/bin/perl use warnings; use strict; if (@ARGV

Odd problems with alarm()

2008-11-03 Thread Matthew Tice
I've setup a simple (well, I copied it from someone else and modified it) to monitor stale NFS mounts. Some preliminary testing seemed to go okay but this problem crept up on me this weekend. The script is as follows: #!/usr/bin/perl if (@ARGV < 1) { print "Usage:\n"; print "$0