in reply to Re: POD for use feature 'declared_refs' wrong
in thread POD for use feature 'declared_refs' wrong
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°]
D:\tmp\pm>perl -Mfeature=:all -M-warnings sub uc_name { my \$name = \$_[0]; $name = uc $name } $n="ken"; uc_name($n); say $n __END__ KEN
FWIW Perl4 had an aliasing feature with *type-globs, but this was restricted to package vars.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
°) actually I'm even putting the warn into the line before, like this I'm flexible with (un)commenting it.
# warn my $x = ...;
²) corrected spelling twice (= deux fois ;)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: POD for use feature 'declared_refs' wrong
by kcott (Archbishop) on Oct 18, 2021 at 17:55 UTC | |
by LanX (Saint) on Oct 19, 2021 at 09:43 UTC | |
by kcott (Archbishop) on Oct 19, 2021 at 15:14 UTC | |
by swl (Parson) on Oct 19, 2021 at 21:55 UTC | |
by kcott (Archbishop) on Oct 20, 2021 at 02:50 UTC | |
by eyepopslikeamosquito (Archbishop) on Oct 20, 2021 at 04:26 UTC | |
Re^3: POD for use feature 'declared_refs' wrong
by ikegami (Patriarch) on Oct 18, 2021 at 13:33 UTC | |
by kcott (Archbishop) on Oct 19, 2021 at 06:24 UTC |