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:

$hash{'filename'} = [ @array ]; # copies array
Or:
$hash{'filename'} = \@array; # "aliases" array
Then you can access it like ususal:
$hash{'filename'}[0]; $hash{'filename'}[1];

See perlref and perllol for more on this kind of thing.

Cheers,
Tom

Replies are listed 'Best First'.
Re^2: Array in a hash
by Anonymous Monk on Oct 12, 2004 at 21:14 UTC
    that worked, thanks Tom!
Re^2: Array in a hash
by Anonymous Monk on Oct 13, 2004 at 18:26 UTC
    "alias" the original array's contents

    This is more commonly referred to as referencing. Aliasing is a slightly different concept, so using the wrong term should be avoided, especially when you are talking to a newbie.