hm theoretically it should be possible to swap it and generate a (complicated) regex from "monday .. sunday" which sorts the input without explicit sort like the others showed.
But I'm better opting out now! =)
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^3: Challenge: sort weekdays in week-order (grep)
by LanX
in thread Challenge: sort weekdays in week-order (elegantly and efficiently)
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |