in reply to Re^2: Efficient way to verify scalar contents
in thread Efficient way to verify scalar contents
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Efficient way to verify scalar contents
by haukex (Archbishop) on Jun 25, 2020 at 06:36 UTC |