|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Re^5: Why is "any" slow in this case?by ikegami (Patriarch) |
| on Jul 28, 2025 at 18:18 UTC ( [id://11165842]=note: print w/replies, xml ) | Need Help?? |
|
We don't need it to be. As I mentioned, the alternative would be to make make a copy of the matched text on match. The down side is that this would happen even if $1 isn't used. Same goes for all the other vars I mentioned.
That's not how magic works. Get magic changes a variable from something that stores a value, to a function that produces the value on demand. You can either store the value in the var, or generate it each time the var is accessed.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||