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


in reply to Don't know how to resolve

Try this one:
if($d =~ m/^\d{6}$/) { print "Exact match\n"; }