in reply to Array in a hash
(Update: Addressed parent's concerns about "staying intact.")
Represent the subarrays as references to arrays. Depending on what you mean by "stay intact while loaded in the hash," you'll either want to copy or "alias" the original array's contents:
Or:$hash{'filename'} = [ @array ]; # copies array
Then you can access it like ususal:$hash{'filename'} = \@array; # "aliases" array
$hash{'filename'}[0]; $hash{'filename'}[1];
See perlref and perllol for more on this kind of thing.
Cheers,
Tom
Tom Moertel : Blog / Talks / CPAN / LectroTest / PXSL / Coffee / Movie Rating Decoder
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array in a hash
by Anonymous Monk on Oct 12, 2004 at 21:14 UTC | |
|
Re^2: Array in a hash
by Anonymous Monk on Oct 13, 2004 at 18:26 UTC |