in reply to regexps and hashes
change it towhile (<FILEDATA>) { $match = <FILEDATA>; if ($match =~ /^TTITLE(\d+)=(.+)$/) { $title{$1} = $2; } }
and it should work properly. Your 2 calls to <FILEDATA> are causing 2 reads to happen, making it skip every other line (as you discovered).while (<FILEDATA>) { $match = $_; if ($match =~ /^TTITLE(\d+)=(.+)$/) { $title{$1} = $2; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: regexps and hashes
by Vane (Novice) on May 15, 2000 at 22:35 UTC | |
|
RE: RE: regexps and hashes
by base_16 (Beadle) on May 15, 2000 at 21:47 UTC |