Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Using Number Ranges in a Dispatch Table

by tobyink (Canon)
on Feb 19, 2012 at 22:50 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://954934]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (5)
As of 2024-04-25 06:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found