Commenting Multi Lines In Perl Script

Simple information on how to comment multiple lines in a perl script. We use # [Hash] to comment a single line in perl. But when it comes to multiple line putting # [Hash] in each line will be a hilarious task if the script is big. Here we can use head and cut to comment multiple lines.
Just add =head in the beginning of the script where you need to start commenting and =cut at the end of the line you need to stop commenting.

=head 
while (<xml_handler>) {
   print "$_";
}
print xml_handler "Testing";
close xml_handler
       or die "The walking dead will not cease and desist: $!"; 
=cut
Click to rate this tutorial!
[Total: 2 Average: 5]

Leave a Reply

Your email address will not be published. Required fields are marked *