in reply to POSIX strftime format question

sub suffer { BEGIN { our %suff = (1,'st', 2,'nd', 3,'rd', 21,'st', 22,'nd', 23, +'rd', 31,'st'); } return $_[0] . ($suff{$_[0]} ? $suff{$_[0]} : 'th'); }
This takes about 3/8 the time to run at large numbers of iterations as either of the other posted suggestions, though none of the routines take a lot of time to run.