chomp $pass1;
if(! $pass1 ) {
print "\n\nIt's just plain stupid to not have a password. Try again!\n";
- } elsif ( $pass1 !~ /^.{3,16}$/ ) {
- print "The password must be 3-16 characters in length.";
+ } elsif ( $pass1 !~ /^[a-zA-Z0-9-_]{3,16}$/ ) {
+ print "\n\nThe password must be 3-16 characters in length, " .
+ "and it may\ncontain only letters, digits, " .
+ "underscores (_), and hyphens (-).\n";
}
}
print "\nPlease retype the password to verify: ";