in reply to initialization errors perl hash

Line 8 is " $pages{$page}++; ".

If your input line ($line) is blank/empty, $page would be undef.

This would result in The warning message you get.

The fix is to check that you do get data - above line 8, add the line:

next unless $page;
FYI - Line 17 refers to the input data line 17, which you have not shown in your post, probably because it was not visible - just a blank line.

            "XML is like violence: if it doesn't solve your problem, use more."