in reply to Array in a Hash
%db = ( 'key1' => { 'key2' => [ [ ['one_value'], ['two_value'] ], [ ['three_value'], ['four_value'] ] ] } );
mstone's way, using $db{'key1'}{'key2'}[0][0] = "one_value";, produces this hash:
%db = ( 'key1' => { 'key2' => [ [ 'one_value', 'two_value' ], [ 'three_value', 'four_value' ] ] } );
The only difference between the two is that referencing it as an array (@{$db{...}}) adds square brackets around the values. But what difference does this create in reading/storing values?
(Hash printout via Data::Dumper)
UPDATE: So, I should use mstone's code?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Array in a Hash
by boo_radley (Parson) on Dec 14, 2001 at 19:50 UTC |