Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: Using Number Ranges in a Dispatch Table

by tobyink (Abbot)
on Feb 19, 2012 at 22:50 UTC ( #954934=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    {
       package Smart::Dispatch::ConditionList;
    ...
          ref $_[0] eq 'CODE' ? 'dispatch' : 'value';
       }
    }
    
  2. or download this
    use 5.010;
    use strict;
    ...
    # call dispatch table on '1000' but only if the dispatch table
    # has an entry that covers value '4'.
    say $dispatch.1000 if $dispatch ~~ 4;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2016-06-29 06:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (369 votes). Check out past polls.