Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I am currently trying to put together a dbm sub routen. The problem I'm having is that I have four arrays that have to go into one hash. Does, anyone have any ideas on how I can do this? Bobby curtibp@world4.net

Replies are listed 'Best First'.
Re: Arrays to Hash
by Fastolfe (Vicar) on Sep 22, 2000 at 01:14 UTC
    Need more information.

    If you want 4 arrays to go into one hash value:

    @a1 = (1, 2, 3); @a2 = ...; @a3 = ...; @a4 = ...; $some_hash{$some_key} = [ \@a1, \@a2, \@a3, \@a4 ]; print "First array, 2nd value: "; print $some_hash{$some_key}->[0]->[1]; # 2
    I don't really know if that's what you're asking, but if I read your question literally, it is. Otherwise, follow up your post with something that gives us some specifics about what exactly you're trying to do.
Re: Arrays to Hash
by merlyn (Sage) on Sep 22, 2000 at 01:03 UTC