As many who hang out in Chatterbox already know, I've been fighting with learning hashes for quite some time. Its the only data structure in Perl that gives me fits. I'm also trying to ramp up on some templating in Perl, for a big project I'm going to be working on very soon. I've decided that HTML::Template fits the bill for my needs in the short term.

To that end, I've been trying to find little reasons to give me more challenges to force me to learn how to build and use hashes better. I'm starting to "get it". tye's help and this hash howto helped quite a bit, as did the help of many seasoned monks in the CB (you know who you are).

I've been frustratred with some of the boring logging on my server, and I found something called BirdTrap, which basically logs and sends an email for every ErrorDocument Apache serves up. If you look at the code, its pretty monolithic and flat. It looks like perl4'ish code. Its dying for a hash infusion.

To that end, I decided to take that concept and write a replacement that uses hashes, HTML::Template, and MIME::Lite to do its dirty work. I've linted it for cross-site scripting attacks (xSS). I think I've covered all of the possibililities (did I miss any?). Its also 30% of the size of the original.

The only thing left to do, is create a hash on a per-domain basis, so I can email these errors to the owner of the domain, instead of to one solid address (see? More hash training!)

Does this look like a good transition from nothing to something? I'm looking for some other practical ways I can learn more about hashes, and use them in an every day capacity.

Where else can I look for some hash "puzzles" that I can use?


In reply to Mashing with Hashing by hacker

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.