Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Revision 2: Switch/case as a dispatch table with C-style fall-through

by Roy Johnson (Monsignor)
on May 16, 2005 at 15:20 UTC ( #457491=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!perl
    use strict;
    ...
    ok(Case::switch('foo'), 'term, no sub');
    diag("Should get a malformed switch warning");
    ok(Case::switch(sub{}, sub{}), 'malformed switch warning');
    
  2. or download this
    package Case;
    
    ...
        };
    }
    1;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2016-06-27 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (337 votes). Check out past polls.