http://www.perlmonks.org?node_id=1006359


in reply to Breaking down whole number into digits

Ignoring (because you've given us no hint of how you plan to translate "Nov" to 11), you can, of course, use a regex to separate a number like "11" into separate digits:

>perl -E "my $foo=11; if ($foo =~ /(\d{1})(\d{1})/) { say \"$1 \t $2\" +;}" 1 1

Note that this is NOT a recommended approach since it doesn't deal with "1995" or with the ...say, second day of a month.