Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by ikegami (Patriarch)
on Jul 26, 2022 at 14:15 UTC ( [id://11145748]=note: print w/replies, xml ) Need Help??


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

Same approach you took, but clearer and faster:

use Sort::Key qw( ikeysort ); my @sorted = ikeysort { $order{ fc( $_ ) } } @unsorted;
  • Comment on Re: Challenge: sort weekdays in week-order (elegantly and efficiently)
  • Download Code

Replies are listed 'Best First'.
Re^2: Challenge: sort weekdays in week-order (elegantly and efficiently)
by LanX (Saint) on Jul 26, 2022 at 15:45 UTC

      yup, overlooked that one.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2024-04-25 16:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found