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; } }
In reply to RE: regexps and hashes
by lhoward
in thread regexps and hashes
by base_16
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |