Re: one or two alarm(0)

2009-07-13 Thread Chas. Owens
On Mon, Jul 13, 2009 at 22:57, Jenn G. wrote: > Hello, > > From the code below: > >  eval { >    local $SIG{ALRM} = sub { die "TIMEOUT\n" }; >    alarm($seconds); >    ... code to execute with timeout here ... >    alarm(0);  # cancel alarm (if code ran fast) >  }; >  alarm(0);    # cancel alarm (i

one or two alarm(0)

2009-07-13 Thread Jenn G.
Hello, >From the code below: eval { local $SIG{ALRM} = sub { die "TIMEOUT\n" }; alarm($seconds); ... code to execute with timeout here ... alarm(0); # cancel alarm (if code ran fast) }; alarm(0);# cancel alarm (if eval failed) Is the second alarm(0) needed or not? In

Re: Making functions more reusable

2009-07-13 Thread Dermot
2009/7/11 Steve Bertrand : > I have numerous methods such as the following. They all perform the same > basic function based on the parameter passed in ($name, $key or nothing). > > I've recently moved out the actual data definition (hash) into a > different 'private' function in order to make thin