Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Hash Problem!

by NetWallah (Abbot)
on Sep 30, 2008 at 00:56 UTC ( #714447=note: print w/ replies, xml ) Need Help??


in reply to Hash Problem!

No - this is not a HOH - it is a HOAOH.

Try:

# Assuming your outside hash is named %h, print $h{main_data}[1]{AMOUNT} . "\n";
Update: A somewhat more advanced approach: (Assuming %h is the outside hash)
for (map {@$_} values %h){ print "Account " . $_->{ACCOUNT} . " AMOUNT: " if exists $_->{ACCOUN +T}; next unless exists $_->{AMOUNT}; print $_->{AMOUNT} . "\n"; } # --- Output --- # Account 6510334 AMOUNT: 200.00 # Account 6510334 AMOUNT: 0.00

     Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax


Comment on Re: Hash Problem!
Select or Download Code
Re^2: Hash Problem!
by cLive ;-) (Parson) on Sep 30, 2008 at 02:10 UTC
    AOH not HOAOH
      If you are talking about the content inside the [..], then I'd agree that it contains an AOH.

      From my perspective, the outermost
      'main_data' => [...
      indicates that it is either a hash or hashref. Of course, the programmer could be misusing the "=>" instead of a comma, making the outermost element an array, but that is marginally perverse.

      So. in the absence of information to the contrary, I'll stick with my interpretation of HOAOH.

           Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-08-20 10:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (110 votes), past polls