in reply to How to make a hash out of two arrays,one with keys and other with values?

This works:
my @Arrayone = ('A','B','C','D'); my @Arraytwo = ('1','2','3','4'); my (%Arraythree, $ct); for ($ct=0; $ct <= $#Arrayone; $ct++) { $Arraythree{$Arrayone[$ct]} = $Arraytwo[$ct]; }
This assumes that keys array and values array match up.

|\/|artin

  • Comment on Re: How to make a hash out of two arrays,one with keys and other with values?
  • Download Code