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 dbuckhal (Chaplain)
on Jan 07, 2014 at 06:11 UTC ( [id://1069608]=note: print w/replies, xml ) Need Help??


in reply to Not getting desire output by using switch statement in Perl

Tired and should be doing homework, but...
$ perl -le '$alpha = "abcdefghijklmnopqrstuvwxyz"; $str = "This is a String"; print grep { ($_) } map { 1 + index($alpha, $_), "\n" } split //,lc($str)' __output__ 20 8 9 19 9 19 1 19 20 18 9 14 7
Perl is so fun...

Log In?
Username:
Password:

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

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

    No recent polls found