Now maybe is the time to investigate the difference between the two values.
Have you printed out their length? Have you compared their values as Perl perceives them?
...
my $last_page;
foreach my $page (@files) {
warn "Now opening different page.";
warn "Old: [$last_page] New: [$page]";
warn sprintf "Length: Old: %d New: %d", length $last_page, length
+$page;
warn "They are " . ($last_page ne $page ? "not" : "" ) . " equal";
my $xp = XML::XPath->new(filename => $page);
$last_page= $page;
...
};
|