The real pain here is that the files have to be in sync otherwise the data becomes a mess.
Given the above: my @MyArray1 = qw(5 4 3 2 1 6 9 11 12); my @MyArray2 = qw(cat dog mouse mice tree shrub sap unix max); if ( scalar(@MyArray1) != scalar(@MyArray2) ) { printf "Expecting two equal size arrays, but got the following:\n"; printf "MyArray1: %5d MyArray2: %5d\n"; die "Incorrect data setup"; } my %MyHash = (); while ( scalar(@MyArray1) ) { my $MyKey = pop(@MyArray1); my $MyData = pop(@MyArray2); $MyHash{$MyKey} = $MyData; } foreach my $MyKey (sort {$a <=> $b} keys %MyHash) { printf "%4d: %-s\n", $MyKey, $MyHash{$MyKey}; } Output: 1: tree 2: mice 3: mouse 4: dog 5: cat 6: shrub 9: sap 11: unix 12: max A start. Wags ;) -----Original Message----- From: Fogle Cpl Shawn B [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 20, 2002 13:48 To: '[EMAIL PROTECTED]' Subject: @array to %hash I have 2 arrays I would like to make into a (one) hash. One array for keys. One array for values. I'm sure this may be an easy thing, but my lack of imagination is killing me (and I need something a little more comprehensive than Beginners Perl) tia shawn -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ********************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. **************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]