Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by Eily (Prior)
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 browsing the Monastery: (6)
As of 2019-03-26 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How do you Carpe diem?





    Results (125 votes). Check out past polls.

    Notices?