Thursday 20 February 2014

Miniblog 2: How to make Multiline Comments in Perl


Perl programming language supports two kinds of comments. One is the single line comment that everybody knows about. It's made by prefixing a "#" symbol to any line like:

# This is a comment. This will not run

What many don't know is that there is a known way to make multi-line comments too. It can be done by adding a "=pod" before and "=cut" after the commented lines like:

=pod
This line has been commented and won't be interpreted
This line too
   Yes this line too!!
And this one as well is commented between the show pod-cut
Pod-Cut combos are for documentation comments but we can use 
 them for multi-line comments too
Enjoy! :)
=cut


0 comments:

Post a Comment

All Articles © Asit. No Copying. Powered by Blogger.
 
Copyright © . The Tech Veda - Posts · Comments
Markup Powered by Bluefish Editor 2.2