I changed my code Like you sugessted. that got rid of the "out of memory
issue" but it's still not sorting the array baised on $a->[1] or $a->[8], Or
in english, It's sorting the list biased on the 8th colum, or any colum for
that matter.

I don't know why I'm having such a hard time understanding this sort
function. The Subroutine passed to the sort function confusses me, It's not
a real subroutin but it is somehow. And how sort uses the sub to figure out
how to sort what, and
in what order, is blowing my mind.



-----Original Message-----
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 3:57 PM
To: 'Derrick (Thrawn01)'; Perl Beginners
Subject: RE: Out of memory on sort !!!!


> @sorted = sort { $data[$a] [0] <=> $data[$b] [0] } @data;

In the sort block, $a and $b are *elements* of @data, not *subscripts*. Your
sort block should be more like

   { $a->[0] <=> $b->[0] }

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to