I’m teaching myself Perl with the help of some internet tutorials, and for the most part it’s going really well and everything runs smoothly. However, I cannot do ANY comments, whatsoever, or the program won’t run properly. For example, the following code:
#eee
print "Estimation of Pi";
will run, but not print anything, while just this
print "Estimation of Pi";
runs and prints what it’s meant to.
What am I doing wrong? I don’t understand this at all.
Also, on a side note, what is #!/usr/bin/perl needed for? My programs seem to be running fine without it (and being a comment, the programs don’t work WITH it)
I suspect your file doesn’t contain what you think it does. Perhaps you have a CR instead of a LF or CRLF.
Examine your file with a hex editor, or at worse with the following command:
#!is a unix concept. Windows doesn’t use it, but Perl will look for command line option on that line. For example, the following will warn: