in reply to Parsing a Simple Log File
Several problems here.
- next if /^\s+$/ skips lines containing nothing but whitespace, but doesn't skip lines that are completely empty. Use next if /^\s*$/ or next unless /\S/ instead.
- The capturing regexes used to extract title and row aren't anchored. Use m/^\s(\D+)$/i and m/^\s+(\d+)$/i.
- In the final map, you iterate over %record. Iterate over keys %record instead.