P is for Practical | |
PerlMonks |
Mashing with Hashingby hacker (Priest) |
on Feb 24, 2005 at 15:28 UTC ( [id://434094]=perlmeditation: print w/replies, xml ) | Need Help?? |
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?
Back to
Meditations
|
|