Subject: | Use of uninitialized value in eval when attribute isn't found |
If warnings are turned on globally via 'perl -w', uninitialized value
warnings start to appear from XML::Twig::first_elt and
XML::Twig::Elt::first_descendant when an XPATH-like search is made for
an element that isn't found.
Examples:
$element = $twig->first_elt("*[\@id='$id']");
$element = $twigroot->first_descendant("*[\@id='$id']");
If no element has an id matching $id, a warning along the lines of:
Use of uninitialized value in string eq at (eval 39) line 1.
is emitted.
When this happens inside a loop (because, for instance, you are
searching for the first element containing one out of a list of IDs),
the resulting spew can cause automated smoke test reports to truncate
and become useless.