Philip M. Gollucci wrote:
> Stas Bekman wrote:
>
>>> +sub cmp_tuples {
>>> +
>>> + my($a, $b) = @_;
>>> +
>>> + while (@$a && @$b) {
>>> + my $cmp = shift @$a <=> shift @$b;
>>> + return $cmp if $cmp;
>>> + }
>>> +
>>> + return @$a <=> @$b;
>>> +}
>>
>> Philip, please avoid using $a and $b in any code, but sort()
>> callbacks, as they are special in perl and may have bad side effects.
>
> Gozer wrote that :)Yup, it was only an example ;-) But, really, stas is correct, $a and $b can have some nasty side effects. -------------------------------------------------------------------------------- Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5 http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
signature.asc
Description: OpenPGP digital signature
