in reply to Quickie regular expression question.

if ($newpasswd =~ /(?:\W|_)/) { # EXECUTE SOME THINGS }