in reply to Quickie regular expression question.

What you're testing is if $newpasswd doesn't contain any characters from the range [A-Za-z0-9].

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; }