populating a HoA with regexpby asqwerty (Acolyte)
|on Aug 28, 2012 at 13:45 UTC||Need Help??|
asqwerty has asked for the
wisdom of the Perl Monks concerning the following question:
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?