Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by dbuckhal (Hermit)
on Jan 07, 2014 at 06:11 UTC ( #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
Node Status?
node history
Node Type: note [id://1069608]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2019-10-20 20:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?