Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: XML::Twig - how can I test for an attribute when the attribute value is 0?by kcott (Archbishop) |
on Aug 30, 2012 at 00:38 UTC ( [id://990607]=note: print w/replies, xml ) | Need Help?? |
I'm not an XML::Twig user; however, its documentation has:
So, you should be able to determine if fq is present with exists:
This will return true even if the value is undef. Assuming the attribute exists, you may also want to check the value with defined and possibly even length (to check for a zero-length string) before checking for truth or specific values. -- Ken
In Section
Seekers of Perl Wisdom
|
|