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

Re: Simple IF, IF, IF or ELSE

by ikegami (Patriarch)
on Jun 28, 2006 at 20:48 UTC ( [id://558145]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if    ($punter eq 'coffee') { $drink = 'non alky';    }
    elsif ($punter eq 'beer'  ) { $drink = 'alky';        }
    elsif ($punter eq 'whisky') { $drink = 'proper alky'; }
    else                        { $drink = 'unknown';     }
    
  2. or download this
    my %lookup = (
       'coffee' => 'non alky',
    ...
    } else {
       $drink = 'unknown';
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (11)
As of 2024-04-19 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found