Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Parsing hashes with variable structure

by frozenwithjoy (Curate)
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"} ) {...}


Comment on Re^3: Parsing hashes with variable structure
Select or Download Code
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 examining the Monastery: (15)
As of 2014-11-21 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (114 votes), past polls