Answer to Question #28635 in Perl for Unix
2013-04-17T07:30:09-04:00
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
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 !
Learn more about our help with Assignments:
Perl
Comments
Leave a comment