Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: RFC: I rewrote a custom sort function, but not sure if it is the best way.

by roboticus (Chancellor)
on Mar 03, 2013 at 15:46 UTC ( #1021505=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub my_sort_index {
        my ($c, $d) = @_;
    ...
        ++$return_value  if $d =~ /^index\./;
        return $return_value;
    }
    
  2. or download this
    my @sorted = sort { my_index_sort($a,$b) || $b cmp $a } @list;
    
  3. or download this
    sub convert_name_to_L_F_M_Extras {
        # Lots of ugly code to split the name into bits, determine which b
    +it goes where, and
    ...
    
    # Now throw away the transformed names and keep only the list of sorte
    +d names.
    @sorted = map { $_->[1] } @sorted;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (12)
As of 2015-07-02 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls