Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Comparing spaceships (cmp and <=> as options)

by Random_Walk (Prior)
on May 20, 2013 at 15:31 UTC ( [id://1034352]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $sort = 'hours'; # really comes from a switch
    
    ...
       ) {
       print join ", ", @$_;
    }
    
  2. or download this
    my %map = (
        hours  => sub {sort { $_[0] <=> $_[0] } };,
    ...
        name   => sub {sort { $_[0] <=> $_[0] } };,
        task   => sub {sort { $_[0] <=> $_[0] } };,
    );
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2024-04-26 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found