Luke Palmer wrote:
> Jonathan Lang writes:
> > How about including something similar to <==, but which binds the
> > elements of the list to the various positional parameters?  For 
> > instance: 
> > 
> >   @sorted = sort {infix:<=> args map {$_.foo('bar').compute}, 
> >                   $^a, $^b } @unsorted; 
> > 
> > Where
> > 
> >   @x = $a, $b, $c; 
> >   routine args @x; 
> > 
> > is equivelent to
> > 
> >   routine $a, $b, $c;
> 
> We already have that.  It's spelled:
> 
>     routine [EMAIL PROTECTED];
> 
> Or
> 
>     routine * <== @x;

Then you've got your solution:

  @sorted = sort {infix:<=> * map {$_.foo('bar').compute}, $^a, $^b }
            @unsorted; 

or

  @sorted = sort {($^a, $^b) ==>
                  map {$_.foo('bar').compute} ==>
                  infix:<=> * } @unsorted; 

=====
Jonathan "Dataweaver" Lang

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

Reply via email to