Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Hashes of Hashes of Arrays? Is it possible?

by toolic (Bishop)
on Sep 08, 2011 at 18:43 UTC ( [id://924901]=note: print w/replies, xml ) Need Help??


in reply to Hashes of Hashes of Arrays? Is it possible?

You seem to be on the right track. What is your expected output?
use warnings; use strict; use Data::Dumper; $Data::Dumper::Sortkeys = 1; my %HOH; my $key = 'foo'; my $value = 5; my $value2 = 6; $HOH{$key}{"name"} = $value; push(@{$HOH{$key}{"price"}}, $value2); push(@{$HOH{$key}{"price"}}, 99); print Dumper(\%HOH); __END__ $VAR1 = { 'foo' => { 'name' => 5, 'price' => [ 6, 99 ] } };
That shows an array of prices.

perldsc

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-25 06:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found