in reply to Regex Pattern Problem

boo_radley's solution is intriguing:
unless ($num =~ /^\d{5,}/ && $num !~/\w/)
According to Robert's Perl Tutorial "The \w construct actually means 'word' - equivalent to a-zA-Z_0-9"

Because \w includes digits it looks as if this regex might reject all numbers. I tried out the following code here:

my $num = "123456"; unless ($num =~ /^\d{5,}/ && $num !~/\w/) { print p("Sorry, $num does not match the regex"); } else {print p("$num matched")};
and sure enough the number 123456 did not match the regex.