if( exists $xml->{$usernumber}->{"user"}->{"firstname"} ) {...}
EDIT: You may also need to extend it as such: (but it is difficult to tell for sure w/o seeing more context)
if( ref eq 'HASH' and exists $xml->{$usernumber}->{"user"}->{"firstnam +e"} ) {...}
In reply to Re^3: Parsing hashes with variable structure
by frozenwithjoy
in thread Parsing hashes with variable structure
by SomeNoob
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |