|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: 'local' for imported variables doesn't work as expectedby LanX (Saint) |
| on Oct 04, 2024 at 10:41 UTC ( [id://11162051]=note: print w/replies, xml ) | Need Help?? |
|
Hmm not sure what's wrong in your setting... I ran a quick test on my mobile, and this works for me. Probably an issue with Exporter ?
Anyway I'd rather recommend another design, like using caller to get the function's name or setting a regex to parse the message for keywords. HTH :)
EDITAHH, got it. What exporter does is to only export the scalar slot, which is causing your problem. *::var = \$var; # replace! Effect:
So exporting the whole typeglob will fix it.:). In case exporter doesn't support * , use your own import
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||