Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Efficient way to verify scalar contents

by choroba (Cardinal)
on Jun 22, 2020 at 09:17 UTC ( [id://11118354]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @RE = (qr/[[:lower:]]/, qr/[[:upper:]]/, qr/[0-9]/, qr/[^[:alnum:]]
    +/);
    sub check {
    ...
        return if $length < 20 && (! /$RE[0]/ || ! /$RE[1]/);
        return 1
    }
    
  2. or download this
    use List::Util qw{ any };
    
    ...
        return if $length < 20 && any { $password !~ $RE[$_] } 0 .. 1;
        return 1
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118354]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2024-04-24 20:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found