in reply to multi dimension array
This is the way to do it as a hash. I doubt this is helpful though.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;
Update: Added missing square brackets. (I guess I should have tested it.)
Better yet use borisz's example below.
|
---|
In Section
Seekers of Perl Wisdom