Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Parsing hashes with variable structure

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


in reply to Parsing hashes with variable structure

What do line 138 and relevant surrounding lines look like?
  • Comment on Re: Parsing hashes with variable structure

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

    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.

      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://1003034]
help
Chatterbox?
choroba still has one more.
[Corion]: I have Thursday and Friday off, so then I might get to converting the rough outlines to more articles ;)
[Corion]: But currently, most of the modules are web-related and I don't like to publish two web articles in a row
[Corion]: Maybe I should do the Filter::Simple release on the next weeked - this would give me one more article to milk from this theme

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-04-24 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (437 votes). Check out past polls.