[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] pop (keys %hash) ?



On Fri, Jun 18, 1999 at 02:46:37PM -0400, Simply Hao wrote:
> No order?  Try ordering then.  :)
> 
>     sub myorder { $a cmp $b }
>     my $lastkey = pop @{[sort { myorder } keys %hash]};
> 
> Hmm, S.T. again....
> 

sub { $a cmp $b } is the default sort function, so there is no need to
specify it, and doing so might even slow down your code.

Not sure what you would do with a Schwartzian Transform here, since the
sort function in this code is already as simple as it can be.

Ronald

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org