Advanced techniques?

I use them all of the time, and the trick is that they are not very hard (at least not in Perl). For instance a hash of hashes? That is just a directory structure:

# Name it absolutely $foo{some}{path}{to}{the}{thing}{I}{want} = "something"; # Or relatively: my $h_ref = $foo{some}{path}; foreach my $thing (keys %$h_ref) { print "Found key '$thing' with value $h_ref->{$thing}\n"; }
It is just an odd delimiter. *shrug*

For the next trick look at map and grep and the general list-oriented nature of Perl and see it as a Unix pipeline written (unfortunately) right to left instead of left to right. Now stare at the Schwartzian sort and see why it is so natural.

In no time these "advanced" techniques will feel like part and parcel of how things work... :-)


In reply to Re (tilly) 1: The use of documentation. by tilly
in thread What is it about perl that makes perl so cool? by zigster

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.