laziness, impatience, and hubris | |
PerlMonks |
Re^2: POD for use feature 'declared_refs' wrongby LanX (Saint) |
on Oct 17, 2021 at 20:24 UTC ( [id://11137659]=note: print w/replies, xml ) | Need Help?? |
Thanks Ken, you are right, it's possible to use my $var; in non-void context, actually I'm regularly prepending warn for debugging.° > While these features remain experimental, they're rather unwieldy and probably easy to get wrong: They are indeed not nice to activate, I'd probably write a module bundling those four steps to avoid boilerplate. But the feature is very nice in many circumstances, Brian d Foy² lists some here: it's also very handy when working with aliases, and one doesn't want to litter ones code with cryptic $_[N°]
FWIW Perl4 had an aliasing feature with *type-globs, but this was restricted to package vars.
Cheers Rolf °) actually I'm even putting the warn into the line before, like this I'm flexible with (un)commenting it.
²) corrected spelling twice (= deux fois ;)
In Section
Seekers of Perl Wisdom
|
|