in reply to Comparing two XML Files with XML::Twig
Your code is basically correct except that you change the $fname variable by adding the .last extension before it is used to open the a file. So this same value($router.xml.last) is used for both XML::Twig objects, hence you get files that are identical. Try replacing the following:
$fname="$fname.last"; $RoutersLastState->parsefile($fname); print "Loaded Last State\n";
with this:
$RoutersLastState->parsefile("$fname.last"); print "Loaded Last State\n";
Your results will now end up in $router.xml.changes instead of $router.xml.last.changes.
HTH
|
|---|