in reply to XML::XPath and processing multiple files

If the file list was created under Windows and you working on Unix/Linux/Cygwin, chomp will not be enough. Try this:

foreach $page (@files) { chomp $page; $page =~ s/\r//g; # ... }
or possibly:
<c>foreach $page (@files) { $page =~ s/[\r\n]//g; # ... }