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.