Subject: | XML::Twig::Elt att() accessor behavior change (lvalue issue) |
Since the XML::Twig::Elt att() accessor is :lvalue, its behavior as a
read accessor is changed. Assuming that foo() is an arbitrary
user-defined function, the first instruction below should produce the
same result as the 2-line following sequence:
$result = foo($elt->att('any_attribute'));
$value = $elf->att('any_attribute');
$result = foo($value);
It was true up to XML::Twig 3.35, but it no longer works in 3.36 and
3.37. Due to some lvalue-related side effect, the first form (i.e. when
the att() call is directly used as an argument for another function
call), it *creates* the attribute (with an empty string as value) if it
was not defined.