Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re (tilly) 1: Golf: Arbitrary Alphabetical Sortingby tilly (Archbishop) |
on May 09, 2001 at 21:30 UTC ( [id://79177]=note: print w/replies, xml ) | Need Help?? |
The body is 93 characters. Can handle anything Perl's RE engine can call a character (including null and return), but like chipmunk horribly non-strict and assumes you will not see characters that are not listed in the alphabet.
Two subtle details. The /s is needed if returns are in the alphabet. And you cannot save a character by replacing string with numerical comparison without breaking on fairly small words.
UPDATE (And so we create more legacy code with a stupid hard-coded limit that is bound to come back to bite us...)
UPDATE 2
UPDATE 3
UPDATE 4
UPDATE 5 (The ~0 trick doesn't work with ranges.)
In Section
Meditations
|
|