*grin*  hey, who'm I to argue.  if it don't work, it don't work - I was
wrong, you were right, congratulations.

David


> -----Original Message-----
> From: Joseph P. Discenza [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 02, 2000 12:43 PM
> To: Ihnen, David; [EMAIL PROTECTED]
> Subject: RE: Sort Question [Now: perlguts guru comments welcome]
> 
> 
> (un-jeopardied)
> 
> Ihnen, David wrote, on Monday, October 02, 2000 14:24
> : > From: Joseph P. Discenza [mailto:[EMAIL PROTECTED]]
> : > Sent: Monday, October 02, 2000 10:06 AM
> : > Subject: RE: Sort Question
> : >
> : > Ihnen, David wrote, on Monday, October 02, 2000 12:39
> : > : so something like an array of array references could be 
> sorted by:
> : > :
> : > : @sortedarray = sort {$direction * ($a[$field] cmp $b[$field])}
> : > : @arrayofrefs;
> : >
> : > Hmm...if that's an array of array references, then $a & $b are
> : > array references. Shouldn't that be $a->[$field] and $b->[$field]?
> :
> : Same difference, man.  References, [], both works, use -> 
> for clarity.
> 
> I tried this:
> 
> perl -e "@a = ([0, 1, 2], [8, 9, 10]); $r = $a[0]; print ($r[1]);"
> 
> and
> 
> perl -e "@a = ([0, 1, 2], [8, 9, 10]); $r = $a[0]; print ($r->[1]);"
> 
> $r is clearly an array reference. The first one fails, the second one
> works.
> Now, is it different inside the sort block with $a and $b? 
> Any perlguts
> gurus interested in commenting?
> 
> Now, I could certainly have said $a[0][1] instead of 
> $a[0]->[1] (where I've
> got $r->[1]), but I would be surprised if what you suggest works.
> 
> Joe
> 
> ==============================================================
>           Joseph P. Discenza, Sr. Programmer/Analyst
>                mailto:[EMAIL PROTECTED]
> 
>           Carleton Inc.   http://www.carletoninc.com
>           219.243.6040 ext. 300    fax: 219.243.6060
> 
> Providing Financial Solutions and Compliance for over 30 Years
> 
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
> 
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to