Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^3: Efficient way to verify scalar contents

by perlfan (Vicar)
on Jun 22, 2020 at 05:48 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11118341]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-18 00:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found