I haven't seen this exact error, so I am not sure off hand. But here is the debugging steps I would go through.
What did you use to edit the script? Are you sure it saved a text file? Are you sure it has Unix line endings?
How did you execute it? Did you change the permissions on the file so that it is executable? Did you specify the interpreter by typing:
Or did you type
I can tell that bash tried to execute the script, because of the message (the first word is bash). That shouldn't be happening because you specify perl on the first line of the script.
Also, echo is a shell command, not a perl command, so it wont work anyway. I get this message:
String found where operator expected at ./script line 2, near "echo "Hello""
(Do you need to predeclare echo?)
syntax error at ./script line 2, near "echo "Hello""
Execution of ./script aborted due to compilation errors.
The perl command is print (and perl lines have to end with ":"):