Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

length() and the Schwartzian transform

by hazylife (Monk)
on Feb 27, 2014 at 12:29 UTC ( #1076388=perlquestion: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @sorted = map  { $_->[0] }
              sort { $a->[1] <=> $b->[1] } # use numeric comparison
              map  { [$_, length($_)] }    # calculate the length of the s
    +tring
                   @unsorted;
    
  2. or download this
    #!/usr/bin/perl
    
    ...
    } @arr;
    
    print "\nsorted = @sorted\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1076388]
Approved by Corion
Front-paged by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (12)
As of 2015-07-06 22:00 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 (83 votes), past polls