in reply to regexps and hashes

Your problem is with this piece of code....
while (<FILEDATA>) { $match = <FILEDATA>; if ($match =~ /^TTITLE(\d+)=(.+)$/) { $title{$1} = $2; } }
change it to
while (<FILEDATA>) { $match = $_; 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).

Replies are listed 'Best First'.
RE: RE: regexps and hashes
by Vane (Novice) on May 15, 2000 at 22:35 UTC
    or simply
    while (<FILEDATA>){ if (/^TTITLE(\d+)=(.+)$/) { $title{$1} = $2; } }
RE: RE: regexps and hashes
by base_16 (Beadle) on May 15, 2000 at 21:47 UTC
    Sweet! thanks. This is why i love perlmonks.org....