All the Perl that's Practical to Extract and Report

Navigation

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.

Please Log In to Continue

If I get it right the faulty statement was something like: my $var = 'passed' if cond();, right?
This looks really strange and funny to me. I understand it as execute this statement (which declares a variable) only if the condition is true. If the condition is false then the statement shouldn't be executed, thus no creation of variable. That's not what Perl might do as I'm expecting Jozef to be using "strict" and his module might have not compiled otherwise avoiding this peculiar situation. You where usin

It generally keeps the “pad” (the allocation space for lexicals, basically) around. Sometimes, eg. for recursive calls, it will allocate extra pads that may be garbage-collected later. So this faux-feature actually doesn’t work reliably except in the simplest use cases. It’s a good thing that 5.10 deprecates it and 5.12 will probably throw an error for such usages.