Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 meditating upon the Monastery: (3)
As of 2015-07-05 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls