in reply to Re^2: naming a variable with the datum from another variable
in thread naming a variable with the datum from another variable
Can I put an associative array within another associative array without all the data in them getting jumbled up?Yes. That is a Hash of Hashes, HoH in short. see perlref and perlreftut. In fact you can create any kind of data-structure using perl-hashes and arrays. I donīt know if there is a "deepness"-limit but i doubt that.
Update:#sample set up a hash of hashes my %h = ( key1 => { subkey11 => subval11, subkey21 => subval21 }, key2 => { subkey12 => subval12, subkey22 => subval22 }, ); #access it print $h{key1}->{subkey11}; #loop it for ( keys %{$hash->{key2}} ) { print $hash->{key2}->{$_}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: naming a variable with the datum from another variable
by Tanktalus (Canon) on Feb 12, 2005 at 18:07 UTC |