in reply to
qw(0 st nd rd)[pop=~/(1?.)$/]or"th"
will do any integer.
Note that for pre-5.6 perl you have to do
because qw was translated into split' ','...' during compilation.
Results (354 votes),