in reply to Re: Block commenting
in thread Block commenting

Not a very good idea, as the comment still is interpolated:
use strict; <<COMMENT; $foo = 'bar'; COMMENT
gives:
Global symbol "$foo" requires explicit package name at line 3.

Abigail-II's suggestion of Acme::Comment is pretty serious, if you really want to have multi-line comments the way you want them. Personally, I think Acme::Comment lives in the wrong namespace: it should probably live in the Filter::Comment namespace or so.

Liz

Replies are listed 'Best First'.
Re: Block commenting
by Abigail-II (Bishop) on Nov 04, 2003 at 17:37 UTC
    Personally, I think Acme::Comment lives in the wrong namespace: it should probably live in the Filter::Comment namespace or so.
    I disagree with that. I think that namespaces like Filter::* and Tie::* should be restricted to module that deal with filtering or tieing. It's just not right to make the implementation part of the name space. Just think about it, should all modules that use objects belong in the OO::* name space? And what are you going to do with a module that uses a filter, is hence named Filter::Whatever, and then modifies its implementation so that it uses a different technique?

    It's a bad, bad suggestion.

    Abigail

      Whatever. I think we agree that the Acme:: namespace is even more inappropriate.

      I personally don't care much where it winds up. Anything better than Acme::.

      Liz

        Anything better than Acme

        You should post that to London.pm and see how he reacts. =P

        --
        Allolex

Re^3: Block commenting
by flounder99 (Friar) on Nov 04, 2003 at 17:55 UTC
    use strict; use warnings; <<'COMMENT'; $foo = 'bar'; COMMENT
    Will avoid the interpolation. But you will still get
    Useless use of a constant in void context at temp.pl line 3.
    To avoid that you can do:
    use strict; use warnings; { no warnings; <<'COMMENT'; $foo = 'bar'; COMMENT }
    But that is a lot of work.

    --

    flounder

Re: Re: Re: Block commenting
by Roger (Parson) on Nov 05, 2003 at 00:09 UTC
    Thanks++ for pointing out that the comment is interpolated. However to fix this, I would simply add single quotes around the COMMENT to prevent the HEREDOC to be interpolated.

    use strict; <<'COMMENT' $foo = 'bar'; COMMENT ;