Answer to Question #28635 in Perl for Unix

Question #28635
I have an assignment to convert from latin to Morse and vice versa, but when i run it it has an error and it says : ./proj1: line 1: syntax error near unexpected token `('

the following code is this :

%hash = (
32, ' ',
33, '..--.',
39, '.----.',
44, '--..--',
46, '.-.-.-',
48, '-----',
49, '.----',
50, '..---',
51, '...--',
52, '....-',
53, '.....',
54, '-....',
55, '--...',
56, '---..',
57, '----.',
58, '---...',
61, '-...-',
63, '..--..',
65, '.-',
66, '-...',
67, '-.-.',
68, '-..',
69, '.',
70, '..-.',
71, '--.',
72, '....',
73, '..',
74, '.---',
75, '-.-',
76, '.-..',
77, '--',
78, '-.',
79, '---',
80, '.--.',
81, '--.-',
82, '.-.',
83, '...',
84, '-',
85, '..-',
86, '...-',
87, '.--',
88, '-..-',
89, '-.--',
90, '--..'
);





print "Please, choose one:\n";
print "1. Convert Latin to Morse Code\n";
print "2. Convert Morse Code to Latin\n";
$choice = <>;


if ($choice == 1)
{
print "Enter file name\n";
$file1 = <>;
open (file, $file1);
.... it continues but i dont hav char left
0
Expert's answer

Answer in progress...

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS