in reply to Changing Perl's sort Default
This is one way to "change the default", but i think is a bit odd:
sub sort { sort { $a <=> $b } @_ } @a=qw(1 12 11 102); @a = &sort (@a); print "@a";' Output: 1 11 12 102
It works because &sort calls main::sort, instead of CORE::sort
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Changing Perl's sort Default
by fglock (Vicar) on Oct 24, 2002 at 13:15 UTC | |
A reply falls below the community's threshold of quality. You may see it by logging in. |
In Section
Seekers of Perl Wisdom