On Fri, 8 Dec 2000, Bill Moseley wrote:
> This is slightly off topic, but my guess is Sys::Signal is mostly used by
> mod_perl people. Can someone else test this on their machine?
That's on-topic, Sys::Signal was written by Doug especially for mod_perl
:) Its use should go away when 5.6.1 will be released.
> I have this weird problem where I'm not catching $SIG{ALRM}. The test code
> below is a simple alarm handler that looks like this:
>
> eval {
> local $SIG{__DIE__};
> if ( $timeout ) {
> my $h = Sys::Signal->set(
> ALRM => sub { die "Timeout after $timeout seconds\n" }
> );
> warn "Set Signal $h\n";
> alarm $timeout;
> }
> print "Test 1 Parent reading: $_" while <FH>;
>
> alarm 0 if $timeout;
> };
>
> This isn't working -- but if I simply comment out the if ( $timeout ) block
> it works.
Easy. Look at $h -- it's a lexically scoped variable, inside the block
if($timeout){}. Of course when the block is over the setting disappears,
when $h gets DESTROYed.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:[EMAIL PROTECTED] http://apachetoday.com http://logilune.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]