Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Re: Changing Perl's sort Default

by fglock (Vicar)
on Oct 24, 2002 at 13:15 UTC ( [id://207691]=note: print w/replies, xml ) Need Help??


in reply to Re: Changing Perl's sort Default
in thread Changing Perl's sort Default

This is the "numerical + alphabetical" version:

sub sort { sort { ($a <=> $b) or ($a cmp $b) } @_ } @a=qw( 1 12 11 102 ddd abc cba 1c 1a ); @a = &sort (@a); print "@a\n"; Output: abc cba ddd 1 1a 1c 11 12 102

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://207691]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-28 11:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found