Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

When should I use a dispatch table?

by Limbic~Region (Chancellor)
on Nov 30, 2006 at 23:00 UTC ( #587072=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if    ($item eq 'thing1') { # ... }
    elsif ($item eq 'thing2') { # ... }
    elsif ($item eq 'thing3') { # ... }
    elsif ($item eq 'thing4') { # ... }
    else                      { # ... }
    
  2. or download this
    #!/usr/bin/perl
    use strict;
    ...
        $opt->{t} = $opt->{n} * 10 if ! defined $opt->{t};
        $opt->{u} = 0              if ! defined $opt->{u};
    }
    
  3. or download this
    #!/usr/bin/perl
    use strict;
    ...
            }
        },
    });
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://587072]
Approved by imp
Front-paged by liverpole
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2014-10-23 07:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (124 votes), past polls