in reply to Quickie regular expression question.
What you want instead, is testing if $newpasswd does contain any characters outside the character class [A-Za-z0-9], and then negate the test:
if ($newpasswd !~ /[^A-Za-z0-9]/) { # EXECUTE SOME THINGS; }
|
|---|