I have, on
rare occasion, found use for the `
$list[@list] = ...' syntax, where
push would not make sense.
More idiomatically, the first snippet should be reduced to the following:
| | | my @result = map "$_:$hash{ $_ }", keys %hash
|
I have a hunch that the coder didn't really want an array sorted in the arbitrary order that
keys happens to return, and that this is actually part of a larger body of nonsense :)
The second snippet is an absolute abomination of sanity checking code, which is exactly the sort of thing I was warning you about here :-p
update: Whoops, just noticed that maverick already pointed out the map idiomatization.
MeowChow
s aamecha.s a..a\u$&owag.print
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.