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

Re: Using IF and OR, I'm sure there is a better way

by ikegami (Patriarch)
on Dec 14, 2005 at 23:37 UTC ( [id://516805] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # Setup
    my @ok;
    ...
    if ($ok[$variable]) {
       ...
    }
    
  2. or download this
    # Setup
    my %fruit;
    ...
    if ($fruit{$object}) {
       ...
    }
    
  3. or download this
    # Setup
    my %dispatch = (
    ...
    } else {
       die("Invalid command $command\n");
    }