sub num2ord2 { my $n = shift; # 1 2 3 4 5 6 7 # 123456789012346789012345678901234567890123456789012345678901234567890 $n.(qw(th st nd rd),('th')x16,((qw(th st nd rd),('th')x6)x8))[$n%100] }