in reply to Re: English Date-Suffixes
in thread English Date-Suffixes
If you can live with the risk of the sub stomping on the callers copy of $_ by not localising it, then you could trim a couple more keystrokes by using pop instead of shift, and you also can trim the regex by another 1
pop;/1./?0:qw(0 st nd rd)[$_%10]or'th'
|
|---|