Re: Multiline comment in Perl

[email protected] ("Octavian Rasnita")
Newsgroups perl.beginners
Message-ID <006801c8b73c$cb7b5f00$9200a8c0@octavian>
Hi,

Perl doesn't have a multiline comment mark.

You can use perldoc marks in order to comment what you want, or include the 
content in a string, like:

Perldoc style:

=start
Here
are the
lines you
want to comment
=cut

Or using a string:

q/
Here are
the
lines you
want to comment
/;

The program will work fine, but in the second example, if you use

use warnings;

it will tell you that you used this string in a void context.
If you don't like the warning, you could use:

my $zzz = q/
...
/;

The first way is prefered, but the second way allows you to comment one line 
or more lines using the same syntax.

Octavian

----- Original Message ----- 
From: "sivasakthi" <[email protected]>
To: "beginners perl" <[email protected]>
Sent: Friday, May 16, 2008 12:24 PM
Subject: Multiline comment in Perl


> Hi all,
>
>
> How to comment Multiple lines  in Perl?
>
>
>
> Thanks,
> Siva
>
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.