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

Re: Re: Phonetic Translation

by ellem (Hermit)
on Aug 27, 2003 at 21:01 UTC ( [id://287166]=note: print w/replies, xml ) Need Help??


in reply to Re: Phonetic Translation
in thread Phonetic Translation

Oh, I have used split a zillion times and because I didn't have a character (like , ) to split on I didn't realize I could use it. (No I don't know what I am doing.)

I am sure everyone knows, but in case there is someone who does not there needs to be semi-colon after the hash for the code to compile:
my %trans = ( 1 => "one", 2 => "two", ... z => "zulu", ) ; #<---note semi-colon foreach (split //, $line) { ....
Oh and to deal with the case thing I did this:
print "Enter some letters and numbers: " ; my $line = <STDIN> ; chomp $line ; $print = lc $line ; ... foreach (split //, $print) { ...

--
ellem@optonline.net
There's more than one way to do it, but only some of them actually work.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-29 00:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found