|
|
| No such thing as a small change | |
| PerlMonks |
populating a HoA with regexpby asqwerty (Novice) |
| on Aug 28, 2012 at 13:45 UTC ( #990249=perlquestion: print w/ replies, xml ) | Need Help?? |
|
asqwerty has asked for the
wisdom of the Perl Monks concerning the following question:
Hello Monks, I have a file with a single column of words like this:
I need to put this words into a hash of arrays, separated by its category (brain, lung, kidney), so I wrote this code:
This code actually works and populate the hash in the right way. However, I think the foreach loop can be replaced with a single line. How can I do this?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||||