Do you know where your variables are? | |
PerlMonks |
Re: Variable Scope in a Signal Handler?by Fastolfe (Vicar) |
on Nov 01, 2001 at 22:02 UTC ( [id://122615]=note: print w/replies, xml ) | Need Help?? |
Yes, if you use a global variable or if your signal handler is a closure with a lexical in the scope you're after. Try this simple test and see if it prints out what you expect:
Then try moving $var into the main program and declare it with 'use vars'.
In Section
Seekers of Perl Wisdom
|
|