Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 chilling in the Monastery: (11)
As of 2014-08-28 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (255 votes), past polls