use strict; use warnings; my $variable = join("", ); my @num = qw|zero one two three four five six seven eight nine|; $variable =~ s/(\d)/$num[$1]/g; print "$variable"; __DATA__ This is 1 great time 2 have a 3 way 4some. When 5 and 6 together make 11. Some 8 or 9 of us will see that. #### This is one great time two have a three way foursome. When five and six together make oneone. Some eight or nine of us will see that.