in reply to lexical variables and signal handlers

Use a global pointer:

$SIG{INT} = sub { die "borked on $$ptr"; }; alarm(1); while(1) { my $var = "wibble"; $ptr = \$var; } alarm(0);

Replies are listed 'Best First'.
Re: Re: lexical variables and signal handlers
by !unlike (Beadle) on May 27, 2003 at 14:49 UTC

    Nice idea, cheers

    !unlike

    I write my Perl code like how I like my sex: fast and dirty. ;)