Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: NOT seeing data in HoH

by Riales (Hermit)
on Feb 08, 2012 at 22:08 UTC ( #952602=note: print w/ replies, xml ) Need Help??


in reply to Re^4: NOT seeing data in HoH
in thread add data to HoA

If you're going for a HoH, you'll need keys for each value in the inner hash (like you're using $date as a key in the outer hash). Instead of:

$GSPmsgHash{$date} = { $alertLv, $src, $srcD, $probD, $days_between, }
You probably want:
$GSPmsgHash{$date} = { alert_level => $alertLv, source => $src, source_detail => $srcD, problem_detail => $probD, days_between => $days_between, }
This way, to get the alert level for $date, you would do the following:
my $alert_level = $GSPmsgHash{$date}->{alert_level};


Comment on Re^5: NOT seeing data in HoH
Select or Download Code
Re^6: NOT seeing data in HoH
by dbs (Sexton) on Feb 09, 2012 at 13:51 UTC
    OK I can make that work the way you showed, but I am still wondering why days_between only shows up when I use Data::Dumper. Nevermind I got it working: with: Thx agn!
    for my $k (keys %GSPmsgHash) { print "$k =>\n"; for my $v (values %{$GSPmsgHash{$k}} ) { print " $v\n"; } }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-07-12 17:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls