Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: multi dimension array

by ChuckularOne (Parson)
on Jul 28, 2004 at 12:40 UTC ( #378010=note: print w/ replies, xml ) Need Help??


in reply to multi dimension array

use Data::Dumper; $a = "fruits"; $b = "birds"; $c = "p"; $d = "g"; $e = "c"; $array1{$a}{$c}= [ "peach" ]; $array1{$a}{$d}= [ "grapes" ]; $array1{$b}{$c}= [ "parrot" ]; $array1{$b}{$e}= [ "crow" ]; print Dumper %array1;
This is the way to do it as a hash. I doubt this is helpful though.


Update: Added missing square brackets. (I guess I should have tested it.)
Better yet use borisz's example below.


Comment on Re: multi dimension array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2014-09-22 10:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (188 votes), past polls