That might not work on all your variable names or if some are formatted a bit differently ...

In particular, note that it's possible to go a little nuts with whitespace and the Perl compiler still calmly accepts it. That, and the same basic extinct syntax also works with arrays and array references, which KANAKADANDI has never said are not present in the code.

c:\@Work\Perl>perl -wMstrict -le "print qq{perl version $]}; ;; my @ra = qw(a b c d); my $ar = \@ra; print ${ ra }[2]; print ${ @ ra }[2]; print ${ $ ar }[2]; print ${ @ $ar }[2]; print ${ @ { $ ar } }[2]; ;; my %h = qw(a aye b bee c see); my $hr = \%h; print ${ h }{b}; print ${ % h }{b}; print ${ $ hr }{b}; print ${ % $hr }{b}; print ${ % { $ hr } }{b}; " perl version 5.008009 c c c c c bee bee bee bee bee

Another point I would make is that a search for these extinct forms should be based on a rigorous definition of a Perl identifier (insofar as one can be defined in user code):
    my $identifier = qr{ \b [[:alpha:]_] \w* \b }xms;
(or that's my first cut, anyway — but it doesn't cover "fully qualified" identifiers). See Variable names in perldata.

I think the best automated search-and-replace is still going to need a final manual patching pass running with strictures enabled, which I sure hope KANAKADANDI is able to do!


Give a man a fish:  <%-(-(-(-<


In reply to Re^4: hash dereferencing issue with perl 5.16.3 by AnomalousMonk
in thread hash dereferencing issue with perl 5.16.3 by KANAKADANDI

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.