Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^3: elsif chain vs. dispatch

by ikegami (Pope)
on Apr 27, 2009 at 02:57 UTC ( #760243=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $handler = do { no strict 'refs'; \&{"handle_fieldcode_$code"} };
    ...handle expections somehow?...
    die if !$handler;
    $handler->(@args);
    
  2. or download this
    my $handler = $lookup{$code};
    die if !$handler;
    $handler->(@args);
    
  3. or download this
    my %lookup = map {
       no warnings 'refs';
       $_ => \&{"handle_fieldcode_$_"}
    } 'A'..'Z';
    ...modify %lookup for expections...
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2014-11-29 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (204 votes), past polls