in reply to from array to hash with grep
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.
|
|---|