in reply to syntax error at example.pl line 1
I see the error right away, but say, you don't. Put __END__ right before the complained about line and see if you still get the error. If you still don't see then move the __END__ statement up. Perhaps in this case to below the first "print". That will work. Then you know that the "real error" is between those two points. Rinse, Repeat.
The key tip here is that starting in column 1, put __END__ and that stops the compilation process and runs the code to that point. Often you will see posts here where there is an END statement and then an example printout follows. This is an easy way to put all of the info into a single .pl post.
I very seldom write the whole program before running it. Write code, run code, debug, write more code,... Often I find some mistake early that affects how I write the rest of the code. That's true in assembly, Perl, C or whatever.
|
|---|