Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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?Helpful Member! 

Kero (MIS) (OP)
20 Nov 01 2:53
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,
Kero
sesth (Programmer)
20 Nov 01 3:21
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
$#testArray.

$len = $#testArray + 1;

Thomas
Kero (MIS) (OP)
20 Nov 01 4:21
It's the best tips for me.
Thanks a lot Thomas.

Kero
Helpful Member!  toolkit (Programmer)
20 Nov 01 4:47
Actually, perl does support multiline comments. See the perlpod (Plain Old Documentation) manual pages for more information. An example:

print "hello ";

=pod

This is a comment
And so is this

=cut

print "there\n";

Cheers, Neil
tsdragon (Programmer)
20 Nov 01 9:57
You can also get the length of an array by using the arrayname in a scalar context:

$len = scalar(@array);

Tracy Dryden
tracy@bydisn.com
www.bydisn.com

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

rycamor (Programmer)
20 Nov 01 11:10
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.
tsdragon (Programmer)
20 Nov 01 11:19
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
tracy@bydisn.com
www.bydisn.com

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

toolkit (Programmer)
21 Nov 01 4:53
Rycamor,
vi qualifies as a real editor then - with a little effort
Neil
MikeLacey (MIS)
22 Nov 01 17:59
vi is a real editor for real programmers

Mike
michael.j.lacey@ntlworld.com
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.

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!

Back To Forum

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