Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


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

Rep: Reputation: 40
Comments in Perl


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:
    This is a comment
..but how can I do the same thing in perl?

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

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


This is a comment

Old 07-03-2009, 08:02 AM   #3
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, 10:11 AM   #4
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, 04:41 AM   #5
Senior Member
Registered: Mar 2004
Location: england
Distribution: Debian, Mint, Puppy, Raspbian
Posts: 3,435

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

if you use gvim with syntax it works OK.


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 08:16 AM
about c comments minil Programming 1 05-02-2005 02:32 AM
I need your comments! gcclinux Linux - Games 1 11-02-2004 06:23 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 09:09 PM
Comments Please webboss Linux - General 2 11-15-2002 08:23 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:46 PM.

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