CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [KevinR] converting letters to corresponding numbers: Edit Log



Larkdog
User

Nov 1, 2004, 7:51 AM


Views: 11001
Re: [KevinR] converting letters to corresponding numbers

well, i tried to reuse the %code_hash to convert the numbers back to numbers...but to no avail...so i created the following:


Code
  my %decode_hash = (1 => a, 2 => b, 3 => c, 4 =>d, 5 => e, 6 => f, 7 => g, 8 => h,9 => i, 10 => j, 11 => k, 12 => l, 13 => m, 14 => n, 15 => o,16 => p, 17 => q, 18 => r, 19 => s, 20 => t, 21 => u, 22 => v,23 => w, 24 => x, 25 => y, 26 => z, 27 => '+', 28 => '.', 29 => '?');



well, you can see that i just reversed the assignments. then i tryed this subroutine:


Code
  sub decode {s/$_/$decode_hash{$_}/gi for @coded_message;return (@coded_message);}



but i keep getting a syntax error saying near 'm, 14 => n, 15'



grr, i have tried to fix the post so it wasn't so long, but it keeps making it long, sorry, nothig i can do
www.MrLarkins.com

(This post was
edited by Larkdog on Nov 1, 2004, 8:57 AM)


Edit Log:
Post edited by Larkdog (User) on Nov 1, 2004, 7:53 AM
Post edited by Larkdog (User) on Nov 1, 2004, 7:54 AM
Post edited by Larkdog (User) on Nov 1, 2004, 8:12 AM
Post edited by Larkdog (User) on Nov 1, 2004, 8:55 AM
Post edited by Larkdog (User) on Nov 1, 2004, 8:57 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives