in reply to Re: Challenge: sort weekdays in week-order (elegantly and efficiently)
in thread Challenge: sort weekdays in week-order (elegantly and efficiently)
I was trying something similar but I easily get annoyed by strptime et similia...
Infact even with your code I hit Error parsing time at C:/perl5.26.64bit/perl/lib/Time/Piece.pm line 581.
I'd modify your code to be even more stable, in the case they accept my proposal for 8 days week, adding Lokiday as jolly day free for all :D
my %order = map { split ' ', 'Time::Piece'->strptime("$_", "%d")->strftime('%A %u') } Time::Piece::day_list();
bliako: your solution is already elegant, readable and perlish: dont overcomplicate :)
L*
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Challenge: sort weekdays in week-order -- Lokiday
by choroba (Cardinal) on Jul 22, 2022 at 10:28 UTC | |
by Discipulus (Canon) on Jul 22, 2022 at 11:00 UTC |