in reply to Re^2: XML::XPath and processing multiple files
in thread XML::XPath and processing multiple files

Most likely there is other whitespace at the end of your file names. Or maybe the "first" file exists in two places.

Does the script still fail if you have the line with the first, existing file duplicated?

  • Comment on Re^3: XML::XPath and processing multiple files

Replies are listed 'Best First'.
Re^4: XML::XPath and processing multiple files
by ATLien (Initiate) on Jul 15, 2013 at 14:53 UTC
    Yes it does fail with the first duped. It only works when there is one file in the list. Weird I know.

      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; ... };