Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Efficient way to verify scalar contents

by perlfan (Vicar)
on Jun 22, 2020 at 05:48 UTC ( #11118341=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        when ($_ >= 8 && $_ <= 11)     # $index here is min( 2, 5), so 2
        when ($_ >= 12 && $_ <= 15) {  # $index here is min( 3, 5), so 3
        when ($_ >= 16 && $_ <= 19) {  # $index here is min( 4, 5), so 4
        when ($_ >= 20) {              # $index here is min( 5+,5), so alw
    +ays bounded at 5
    
  2. or download this
    my %check_dispatch = (
      2 => sub { ... }, # or better, define in named subs and, => \&check1
    +, etc
    ...
    if ($check_dispatch{$index} and 'CODE' eq ref $check_dispatch{$index})
    + {
      die if not $check_dispatch{$index}->($pw);
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2021-03-04 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (105 votes). Check out past polls.

    Notices?