go ahead... be a heretic | |
PerlMonks |
Re: Closure Over Scalar?by ikegami (Patriarch) |
on Feb 18, 2021 at 23:36 UTC ( [id://11128544]=note: print w/replies, xml ) | Need Help?? |
The assignment to $FIXED_STRING is found after the sub call. It hasn't been executed when the sub is called. (And using a my var without first executing the my statement is undefined behaviour.) Use
or use state.
Seeking work! You can reach me at ikegami@adaelis.com
In Section
Seekers of Perl Wisdom
|
|