in reply to Working with an Array of Array Names
You really need to read perlref. If you are using a *NIX server, from the command line type;
perldoc perlref
And study away. Now to my "solution";
#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my $arr; push @{$arr->{car}}, ( 4,3,2,1 ); print Dumper $arr;
Some explaination; The $arr->{car} is a reference to a hash where the key is the string "car". The @{ } says to treat the value of the hash as an array. And you know what push does. perlref will be explain it completely.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Working with an Array of Array Names
by idiotek (Initiate) on Oct 07, 2007 at 23:59 UTC | |
by FunkyMonk (Chancellor) on Oct 08, 2007 at 21:00 UTC |