Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

How to multi line comment?

How to multi line comment?

Dear sir,

            I'm new perl programmer. So I can't multi line comment in my program. I must use "#" each line. How can I do?
           And if I want to know length of array. Example I have data in "@testArray". How can I get length of array?

Thanks for your help,

RE: How to multi line comment?

Perl doesn't support multiline comments. You can use the follwing code:

if (0) {
  ... my code

The last element of an array is returned by

$len = $#testArray + 1;


RE: How to multi line comment?

It's the best tips for me.
Thanks a lot Thomas.


RE: How to multi line comment?

Actually, perl does support multiline comments. See the perlpod (Plain Old Documentation) manual pages for more information. An example:

print "hello ";


This is a comment
And so is this


print "there\n";

Cheers, Neil

RE: How to multi line comment?

You can also get the length of an array by using the arrayname in a scalar context:

$len = scalar(@array);

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.

RE: How to multi line comment?

Also, To (mis?) quote Larry Wall, "If your editor can't put a column of sharps on the left margin, then you need real editor." (or words to that effect)

In other words, it's easy if you have an editor that lets you work in column mode; just drag a line down the left side, and hit the # key once.

RE: How to multi line comment?

My editor (EditPlus) has a command that allows you to highlight a group of lines and prefix them all with one or more comment characters.

Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.

RE: How to multi line comment?

vi qualifies as a real editor then - with a little effort

RE: How to multi line comment?

vi is a real editor for real programmers

Email welcome if you're in a hurry or something -- but post in tek-tips as well please, and I will post my reply here as well.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close