and, of course, there are a million other ways to do it.{ my @thsuffix = (qw(th st nd rd), (th) x 6); sub th { my $n = shift; return $n. (($n > 9 and $n < 14) ? 'th' : $thsuffix[substr($n,-1)]) +; } }
sub th { my $n = shift; for ($n) { return $n . "st" if /1$/ and !/11$/; return $n . "nd" if /2$/ and !/12$/; return $n . "rd" if /3$/ and !/13$/; return $n . "th"; } }
In reply to Re: Address conversion
by Zed_Lopez
in thread Address conversion
by tcf22
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |