LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-03-2009, 06:30 AM   #1
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Rep: Reputation: 40
Comments in Perl


Hi.


I'm quite new to Perl, and have a very simple question: How do I add multiline comments in the code? In Java I could to this:
Code:
/*
    This is a comment
*/
..but how can I do the same thing in perl?


Regards,
kenneho
 
Old 07-03-2009, 06:55 AM   #2
PMP
Member
 
Registered: Apr 2009
Location: ~
Distribution: RHEL, Fedora
Posts: 381

Rep: Reputation: 58
Multiline comment can be added in perl
using

=item

This is a comment

=cut
 
Old 07-03-2009, 07:02 AM   #3
Telemachos
Member
 
Registered: May 2007
Distribution: Debian
Posts: 754

Rep: Reputation: 59
Just to clarify: Perl doesn't directly do multiline comments in the way that say C does. A common solution, which PMP suggested, is to use POD for this. See here for more. (Another small tip: always check the FAQ in perldoc. This FAQ entry is the second item found if you try perldoc -q comment.)
 
Old 07-03-2009, 09:11 AM   #4
kenneho
Member
 
Registered: May 2003
Location: Oslo, Norway
Distribution: Ubuntu, Red Hat Enterprise Linux
Posts: 657

Original Poster
Rep: Reputation: 40
Thanks for the quick reply. I find the syntax quite ugly, though... I'm thinking I'm gonna stick with the old "#" comment style.. but thanks for the help anyway!
 
Old 07-06-2009, 03:41 AM   #5
bigearsbilly
Senior Member
 
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,432

Rep: Reputation: 203Reputation: 203Reputation: 203
it is useful though
as you can comment out code.

if you use gvim with syntax it works OK.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
2.6.12 out, comments in :) xushi Slackware 107 07-12-2005 07:16 AM
about c comments minil Programming 1 05-02-2005 01:32 AM
I need your comments! gcclinux Linux - Games 1 11-02-2004 05:23 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM
Comments Please webboss Linux - General 2 11-15-2002 07:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration