in reply to creating a hash from a text file.
while ($line =~ /(\d+)\s+(\w+)/g) { $hash{$1} = $2; }
In your inner loop.
Update: added /g, as noted by AnomalousMonk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: creating a hash from a text file.
by AnomalousMonk (Archbishop) on Jul 27, 2010 at 07:45 UTC |