Results 1 to 6 of 6

Thread: Comments in Perl

  1. #1
    Mentor
    Join Date
    Jun 2001
    Posts
    1,672

    Comments in Perl

    Is there a way to comment out multiple lines in Perl? I'm looking for the equivalent of /* ... */ in C. It's a pain to put the # sign in front of a lot of lines...

  2. #2

    Re: Comments in Perl

    Code:
    qq# 
    if($blah) {
     foo();
     $blah + 10;
    }
    #;
    not the best... but it works. qq#blah#; means "blah" so you can use anything not just #.

    so this really just turns it into a string.

  3. #3

    Re: Comments in Perl

    #'s are not so bad when using VIM.

  4. #4

    Re: Comments in Perl

    Yeah, just hit CTRL-V, then move your cursor down to where you want to end the comments, then press I, then #, then Esc. Now all those lines are commented. You can do CTRL-V, move down, and x to delete the comments, too.

    Ain't Vim great?

  5. #5
    Mentor
    Join Date
    Jun 2001
    Posts
    1,672

    Re: Comments in Perl

    Yeah, just hit CTRL-V, then move your cursor down to where you want to end the comments, then press I, then #, then Esc. Now all those lines are commented. You can do CTRL-V, move down, and x to delete the comments, too.

    Ain't Vim great?
    Vim is probably great, but I don't use it. The question wasn't really how to put the # sign in front of multiple lines, but what is the equivalent of /* ... */ in Perl.

  6. #6

    Re: Comments in Perl

    Code:
    use POD;
    
    =cut
    
    This is what it
    would look like for
    multiple lines of coments
    in perl.
    
    =cut
    OR

    Code:
    <<Comment;
    I am a comment
    comment comment yay
    Comment

Similar Threads

  1. Requests for Comments (RFC)
    By peter in forum Announcements and Suggestions
    Replies: 9
    Last Post: 01-18-2007, 04:35 PM
  2. Two new sub-forums - Comments please
    By peter in forum Announcements and Suggestions
    Replies: 2
    Last Post: 02-14-2006, 12:50 PM
  3. perl question from a perl newb
    By tolstoy in forum Linux - Software, Applications & Programming
    Replies: 4
    Last Post: 09-06-2002, 01:16 AM
  4. Request For Comments
    By njcajun in forum General Chat
    Replies: 10
    Last Post: 06-27-2002, 07:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •