Re: Sorting two parallel arrays

2001-06-12 Thread Jeff 'japhy' Pinyan
On Jun 12, Martin van-Eerde said: >What I need to do is sort the data in the second array in ascending >order and then print out with the corresponding elements from the >first array. > >It seems to work, apart from being in descending order, but my >main problem is perl complaining about a de

Re: Sorting two parallel arrays

2001-06-12 Thread Michael Fowler
On Tue, Jun 12, 2001 at 05:14:19PM +0100, Martin van-Eerde wrote: > Thanks for any help! > > my @first = qw(high medium low apex); > my @second = qw(100.00 50.50 34.25 23.99); > > > my $idx = -1; > my @result = map {$idx ++; $second[$idx].'~'.$_} @first; > > print "merge result:\n"; > print jo