in reply to multi dimension array
You are talking about a hash (otherwise known as an associative array). Here's an example of the Perlish way to construct an associative array similar to what you're depicting.
use Data::Dumper; my %world = ( 'fruits' => { 'p' => 'peach', 'g' => 'grapes', } 'birds' => { 'p' => 'parrot', 'c' => 'crow' } ); print Dumper \%world; print "Accessing individual elements:\n"; print $world{'fruits'}{'p'}, "\n"; print $world{'birds'}{'c'}, "\n";
Please refer to perldata and perlintro for starters, to learn about hashes. For multidimensional structures you'll need to read perlreftut, perllol, and perlref. Enjoy! It's good stuff.
Dave
|
|---|