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

Re: Challenge: sort weekdays in week-order (elegantly and efficiently)

by tybalt89 (Monsignor)
on Jul 21, 2022 at 15:49 UTC ( [id://11145639]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    
    print "$_\n" for
      nsort_by { 'motuwethfrsasu' =~ substr lc, 0, 2; $-[0] } @weekdays;
    
  2. or download this
    Monday
    Thursday
    Saturday
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-28 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found