next up previous contents
Next: Further Reading/Information Up: Writing Perl Programs Previous: Invocation

Comments in Your Program

It is very important to place comments into your Perl programs. Comments will enable you to figure out the intent behind the mechanics of your program. For example, it is very easy to understand that your program adds 66 to another value. But, in two years, you may forget how you derived the number 66 in the first place.

Comments are placed inside a program file using the # character. Everything after the # is ignored. For example comment.pl:

# This whole line is ignored.
print("Perl is easy.\n");  # Here's a half-line comment.



dave@cs.cf.ac.uk