One bareword hardly seems enough:
sub num2ord { local $_ = shift; # 1 2 3 4 # 123456789012346789012345678901234567890 $_.((0,st,nd,rd)[/1?.$/g]||th) }
Update: oops, typo: too many parens at start.
Hugo
In reply to Re^5: Golf - Ordinal Suffixes
by hv
in thread Golf - Ordinal Suffixes
by sauoq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |