Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Parsing hashes with variable structure

by frozenwithjoy (Priest)
on Nov 09, 2012 at 00:40 UTC ( #1003037=note: print w/replies, xml ) Need Help??


in reply to Re^2: Parsing hashes with variable structure
in thread Parsing hashes with variable structure

Perhaps you meant the following? (I added {} around $usernumber)
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"} ) {...}

Replies are listed 'Best First'.
Re^4: Parsing hashes with variable structure
by SomeNoob (Initiate) on Nov 09, 2012 at 00:46 UTC

    That is what I meany, yes, sorry.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003037]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2016-09-29 22:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (562 votes). Check out past polls.