in reply to XML::Twig - how can I test for an attribute when the attribute value is 0?
I'm not an XML::Twig user; however, its documentation has:
- Return a hash ref containing the element attributes
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.