No such thing as a small change | |
PerlMonks |
Re: from array to hash with grepby graq (Curate) |
on Jun 15, 2006 at 08:12 UTC ( [id://555444]=note: print w/replies, xml ) | Need Help?? |
I expect there are plenty of 'use map!' replies before I finish this, but I'll throw my torch light on the subject. This is initially syntactically wrong. You have a list and need to iterate over it somehow. However grep returns the line that matched, not what you 'captured' in $1, so you will match all lines with no change. Hence you need to use map.
-=( Graq )=-
In Section
Seekers of Perl Wisdom
|
|