Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Parsing hashes with variable structure

by SomeNoob (Initiate)
on Nov 09, 2012 at 00:33 UTC ( #1003036=note: print w/ replies, xml ) Need Help??


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

Line 138 itself is the if(exists...) line and it's in the middle of a loop going through the array of references to different user hashes.


Comment on Re^2: Parsing hashes with variable structure
Download Code
Replies are listed 'Best First'.
Re^3: Parsing hashes with variable structure
by frozenwithjoy (Curate) on Nov 09, 2012 at 00:40 UTC
    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"} ) {...}

      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://1003036]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2015-07-29 22:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls