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°]

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 ;)


In reply to Re^2: POD for use feature 'declared_refs' wrong by LanX
in thread POD for use feature 'declared_refs' wrong by LanX

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.