Out of curiosity, I tried tr/// instead of regex, much faster :)
sub validatetr { local $_ = shift; length >= 20 ? 1 : !tr/a-z// || !tr/A-Z// ? 0 : length >= 16 ? 1 : !tr/0-9// ? 0 : length >= 12 ? 1 : !tr/a-zA-Z0-9//c ? 0 : length >= 8 ? 1 : 0; }
In reply to Re^3: Efficient way to verify scalar contents
by tybalt89
in thread Efficient way to verify scalar contents
by x_stream3m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |