in reply to Probably an easy map question
Your usage of map is fine - but it isn't for chomp.
%hash = map { chomp; my ( $a, $b) = split / = /; $a => $b } <INF>;
should do. update: note that $_ is implicit for chomp and split.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Probably an easy map question
by andye (Curate) on Jan 15, 2009 at 17:02 UTC | |
by shmem (Chancellor) on Jan 15, 2009 at 18:48 UTC |