Think about Loose Coupling | |
PerlMonks |
lowercasing during a match?by mordibity (Acolyte) |
on Aug 23, 2002 at 14:23 UTC ( [id://192333]=perlquestion: print w/replies, xml ) | Need Help?? |
mordibity has asked for the wisdom of the Perl Monks concerning the following question:
I have data like this:
I've found it very convenient to parse it like this: Which gives me: (foo => 1, baR => "BOO", Baz => 3) However, ideally, I would like all the keys of my hash to be lowercase so I can than ignore case later when I do lookups. 'map { lc } ' won't work because I'm biting off tokens two at a time. Is there a Perlish way to do this all in one go? (ie, without capturing the matches in a separate step and lowercase the left-hand-side). Thanks!
Back to
Seekers of Perl Wisdom
|
|