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. How to compile Perl
    By tech291083 in forum Redhat / Fedora
    Replies: 3
    Last Post: 06-09-2007, 01:46 PM
  2. Perl module problem
    By Outlaw in forum Linux - Software, Applications & Programming
    Replies: 3
    Last Post: 05-04-2005, 02:17 PM
  3. PERL Problems
    By marce_sadico in forum Redhat / Fedora
    Replies: 0
    Last Post: 08-26-2002, 05:23 PM
  4. Perl escaping - help needed
    By andrzej in forum Linux - Software, Applications & Programming
    Replies: 6
    Last Post: 05-10-2002, 01:21 PM
  5. Learning Perl.
    By Feztaa in forum Linux - Software, Applications & Programming
    Replies: 26
    Last Post: 02-28-2002, 03:26 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
  •