|
|
| Do you know where your variables are? | |
| PerlMonks |
Re^4: Why is "any" slow in this case?by LanX (Saint) |
| on Aug 04, 2025 at 21:28 UTC ( [id://11165957]=note: print w/replies, xml ) | Need Help?? |
|
Yeah I see your point now. Seems like Perl is playing safe if a lexpad is required for the closure, even if the closed over lexical variable doesn't change, like here:
BTW: Clever move to push the code-refs to @subs and keeping them alive instead of printing them out. Like this you are avoiding that Perl tries to reuse a freed ref again! IOW if we see the same ref again we are sure teh sub wasn't generated again.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||