Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Not getting desire output by using switch statement in Perl

by Eily (Monsignor)
on Jan 06, 2014 at 12:02 UTC ( #1069495=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    given ($a)
    {
      when ('a') { print 1};
      when ('b') { print 2};
      ...
    }
    
  2. or download this
    $\ = "\n"; # add a line break after each print, say could be used inst
    +ead
    for my $char (split //, "Hello World")
    {
    ...
          print "Else";
       }
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2019-12-14 02:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?