Comments[edit | edit source]
Comments should be used in your Perl script to help other developers who may look at your project later down the line understand what it is you have done. A comment can be made using the # key.
# This is commented out this is not commented out and is visible to the program meaning the program will try and interpret/compile it
In some text editors, such as Sublime (link at the bottom), you can comment out large sections of code by highlighting the code and pressing ctrl+/. It doesn't matter what language you are coding in, if you have the file saved and sublime knows what file type it is, it will automatically put the right comment syntax in for you. This is useful, to temporarily comment out a section of code, for example while you are re-writing its functionality, or if it is not yet ready to run. (To un-comment large sections in Sublime, just highlight the text and press the same keys).
Comments are also a crucial part to declaring the file type, the authors name, the date the file was made and what it is the program is supposed to do. Developers will not respect your work unless you do this correctly and give them all the details they need. It should be written like this:
#!/bin/usr/perl # Author: (your name) # Date : 2015-06-19 # Code to give an example to the wonderful Perl community on Wikibooks