What are you expecting the value of $error to be when the signal arrives?
Plus, why not simply capture the variable as a closure:
my $error; sub timeout { ... if( $error ) ... ... } ... $SIG{ALRM} = \&timeout;
In reply to Re: Passing arguments to a function reference
by BrowserUk
in thread Passing arguments to a function reference
by MiniMizer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |