in reply to problems with regular expressions

I need to determine if this variable has at least one number and at least one character.

I assume you mean "and at least one letter." It'll have one character if its length is greater than 0.

fail() unless $password =~ /\d/; fail() unless $password =~ /[A-Za-z]/;

By the way, that regular expression is a bit of a mess. First, there seems to have been a transcription error because you never close your character class. Ignoring that though, there's just no reason to escape all of those characters and doing so just makes it difficult to read.

$password =~ /([-\\\/!*+@\s\w$.]/; # This is fine.

Any thoughts would be greatly appreciated.

I'm not a big fan of restricting passwords. That said, I know education isn't always an option. You can usually be sure, though, that if you require that a password has one letter and one number, 70% are going to choose a password of all letters and slap a number on the end. Another 20% will put the number first. So, the real effect, with such simple rules, is actually to reduce the work that a cracker would have to do if he got ahold of your encrypted passwords. You might be better off if you insist that one character other than the first or the last is a non-letter.

fail() unless $password =~ /^.+[^A-Za-z]./;

-sauoq
"My two cents aren't worth a dime.";