Go to
http://guymal.com/mycode/perl_restrict_digits
to see the updated version.