I saw this in someone's post:
@monthPost = (
"-", "st", "nd", "rd", "th", "th", "th", "th", "th",
"th", "th", "th", "th", "th", "th", "th", "th", "th",
"th", "th", "th", "st", "nd", "rd", "th", "th", "th",
"th", "th", "th", "th", "st"
);
$textInput = "$mday$monthPost[$mday]" # etc.
and it reminded me that I once set off a little golf on that topic.
The winner was this (sub) from Jonas Nilsson:
$_[0]=~/1\d$/?0:qw(0 st nd rd)[$_[0]%10]or'th';
--
($_='jjjuuusssttt annootthheer
pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;