Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Acme::Don't

by Juerd (Abbot)
on May 10, 2002 at 22:29 UTC ( #165800=note: print w/replies, xml ) Need Help??

in reply to Acme::Don't

How many time have you been working on some code and wanted to comment out a section of it to test specific code components?


q{ ...; ...; };
Perl will optimize this away, so there's no execution speed involved. Probably the best thing about this is that many color highlighting editors will mark this as a string (which it is), so you can see that it's something not-normal. BEGIN blocks are not BEGIN blocks anymore, they are just part of the never-executed string. It doesn't do any syntax checking (well, you do have to balance your {}'s, or have to choose other delimiters).

Update (Aug 15 2002):

15:07 <@kane_> juerd: it looks elegant, but wanrs =) 15:07 <@Juerd> kane_: I know, but it's perfect for development code. T +he warning is a good reminder, too 15:08 <@Juerd> I can't believe I didn't say anything about warnings in + that post... 15:12 <@Juerd> kane_: Hmmm... use Acme::Comment qw/start q{ end };/ wo +uld work, wouldn't it? :)

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Replies are listed 'Best First'.
Re: Re: Acme::Don't
by cLive ;-) (Prior) on Jun 19, 2002 at 09:53 UTC
    <<'comment'; .... .... .... .... comment
    timtowtdi :)

    cLive ;-)


      Surely they're not quite the same? Acme::Don't's don't {...} is documented as returning undef. When used as the last line of a module, don't { 1 } isn't (sorry) the same as
      <<'comment' 1 comment
        I was just replying to the "how to make a comment part" - not the Acme::Don't. Who cares if they are the same or not? not me :)

        cLive ;-)


        If undef is strictly required, then just:
        undef or do { ... };

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://165800]
[marto]: <tr class="even-row item-004 auth-221725"> is there, but no content seemingly
[Corion]: Hmm - these nodes are usually cached, so something doing the cache update broke, I guess
[Eily]: I do see a content, the n5
[marto]: 5 is an Odd_number
[Corion]: That could fix itself within the next 24 hours :)
[marto]: we should blame LanX
[marto]: purely because he isn't here :P
[Eily]: marto oh ok, since normally it would have been 1, which is odd as well, I didn't think this was what you were refering to
[Eily]: what? Does that mean we can't blame LanX when he's there?
[marto]: but 5 in total, is odd, where as 10 is even

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2018-03-20 09:56 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (249 votes). Check out past polls.