Perl-Sensitive Sunglasses | |
PerlMonks |
PAR: Variable %x will not stay sharedby QM (Parson) |
on May 25, 2006 at 03:37 UTC ( [id://551496]=perlquestion: print w/replies, xml ) | Need Help?? |
QM has asked for the wisdom of the Perl Monks concerning the following question:
I think I know the answer, but I haven't found confirmation...
I have a closure with 3 subs in it, something like this: The script compiles and runs with no warnings or errors, and appears to "do the right thing". However, some of my users want a PAR executable. When making the PAR executable (pp -z 9 -c script.pl), I get errors for all of the enclosed lexicals: ...where line "123" is a line in "script.pl" that references %foo. From my reading I see that this error comes up in Perl when using nested named subs, which isn't the case here. The only thing I can think of is that PAR is somehow wrapping my whole script, which then triggers the sharing warning message under "-c". I've tried to reproduce this with a smaller script, but had no luck yet. (The original script is 1000+ lines.) I'm also wondering if the "\$foo{$key}" confuses the compiler into thinking that's a reference? Any hints? -QM
Back to
Seekers of Perl Wisdom
|
|