Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Perl Monk, Perl Meditation
 
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 musing on the Monastery: (5)
As of 2014-04-20 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (487 votes), past polls