Inspired by above post.
#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11145633 use warnings; use List::AllUtils qw( shuffle sort_by ); my @weekdays = shuffle qw/Monday tuesday wednesday friday sunday Saturday Thursday/; print "@{[ sort_by { lc =~ tr/muwhft/a-e/dr } @weekdays ]}\n";
In reply to Re^2: Challenge: sort weekdays in week-order (elegantly and efficiently)
by tybalt89
in thread Challenge: sort weekdays in week-order (elegantly and efficiently)
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |