Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: using switch

by sgifford (Prior)
on Sep 29, 2005 at 16:10 UTC ( #496157=note: print w/ replies, xml ) Need Help??


in reply to Re^2: using switch
in thread using switch

Just use several if statements:

if ($DIRECTIONS eq 'NORTH') { print "$HERONAME HAS LEFT NORTH\n" } elsif ($DIRECTIONS eq 'SOUTH') { print "$HERONAME HAS LEFT SOUTH\n" } elsif ($DIRECTIONS eq 'EAST') { print "$HERONAME HAS LEFT EAST\n" } elsif ($DIRECTIONS eq 'WEST') { print "$HERONAME HAS LEFT WEST\n" }


Comment on Re^3: using switch
Select or Download Code
Replies are listed 'Best First'.
Re^4: using switch
by jeffa (Bishop) on Sep 29, 2005 at 16:13 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (14)
As of 2015-07-30 14:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (271 votes), past polls