P is for Practical | |
PerlMonks |
(Kozz) Parse into hash of hashrefsby Kozz (Friar) |
on Sep 24, 2002 at 02:57 UTC ( [id://200281]=note: print w/replies, xml ) | Need Help?? |
Perhaps some monks will decrie some inefficiencies in my code, but I think this works fairly well and has been tested:
So you're making a hash of hashrefs - the key of the parent hash is the day of the week, and then "type" and "time" are accessible through each day of the week. Any improvements are welcomed. I may be playing fast and loose with the regex to match the day of the week, depending on what else is in your __DATA__. --Kozz edit: removed unneeded /g modifier from regexes, modified code to get current DOW as seen in BrowserUK's code (I learn something every day)
In Section
Seekers of Perl Wisdom
|
|