Apparently the author is not familiar with this idiom, though it's pretty common.

He does say

Sure, one could pass a reference to a hash with these key value pairs, and then decode the hash inside the subroutine. Again, this is asking the programmer to do what the language should intrinsically understand: in essence, to code around the language.

I missed this the first time I read the article. I'm kind of ambivalent about this way of thinking. I accept the argument as valid, but on the other hand it's not a whole lot of overhead (read: not much syntactic sugar required). The cookbook shows a number of compact techniques for doing this. Although when writing OO Perl, it really is a drag to have to write my $self = shift every single time.

What I have noticed with Perl is that I figure out very few tricks myself from first principles. Just about all of my mastery has come from reading books and other people's code. The only other language that I have observed this is C++. If you haven't read the Gang of Four book, and studied how the STL works, you'll only ever skim the surface.

--
g r i n d e r


In reply to Re: Re: Perl's warts by grinder
in thread Perl's warts by grinder

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.