#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    21
    Rep Power
    0
    To remark a statment.

    We use #
    But I am just curious if there is
    /*
    All lines are remarked
    until a delimiter is found.
    */
    As in the Java way.

    It helps a lot in debugging.

    Currently, I either have to add # to every line.

    Or add
    sub falsefunction() {
    }

    to the top and bottom and then cut them out and paste them below but it is rather stupid to do that.

    So is there a better way to remark multiple lines?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    81
    Rep Power
    15
    There isn't 'officially' a multiline comment as in Java. However, you can kludge it by making the interpreter think that what follows is POD documentation (imagine the following as equivalent to in Java putting /** */ around everything rather than /* */). Before the block you want commented, put:
    =pod
    (first chars on a newline)
    and after the block you want commented, again as first chars on a newline, put
    =cut

    That should do the trick for you. Alternatively, if you can find an editor that 'understands' Perl (e.g. emacs, or on Windows something like UltraEdit or EditPlus) you can get it to comment out a block by selecting a block and telling it to comment out, or insert a certain character at the start of every line (a # in this case), or whatever other way you can persuade it to do commenting.

IMN logo majestic logo threadwatch logo seochat tools logo