Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
This is pretty awesome -- I could see it being applied to a range of things other than debugging (and perhaps some holy wars breaking out about what might constitute overuse or misuse of the idea).

Because of its potential, I think the tendancy to give it a name related to debugging would be... well, constraining or inapt somehow -- it might limit people's perception about what it's really doing, and what it's able to do.

Keeping it as "=begin" seems okay (especially if folks follow Mr. Muskrat's idea of always terminating the conditional code with "=end"). Another possibility would be to call it something like "=run_when" -- e.g.:

=run_when ODDBALL_OS_VERSION. use Local::Module::ForODDOSV; # nice to have a new way to do this! =cut ... while (<BLAH>) { ... =run_when DEBUGGING warn "reading BLAH and got: $_" =cut ... =run_when TESTING $expected = "What should happen here"; warn "This isn't working\n" unless ( $expected eq some_test()); =cut ... =run_when BORED print "Did you do something different with your hair today?\n"; =cut
If you feel that C-like pre-processor directives are really second nature to just about everybody who uses Perl, then you could try "=ifdefined" -- this wouldn't be any worse that "=begin", I think, but really, what's in a name? "bless" by any other name would be no less abstract...

I guess the next thing to wonder about is whether folks might opt for having selected chunks of pod content be produced or not via perldoc, depending on what's in the environment. (This might be tricky -- how to flag the end of the =begin block within pod, without flagging the end of pod as well. Or does the use of "=begin" impose the end of pod processing already? I confess to not having studied pod grammar all that closely.)


In reply to Re: Debug code out of production systems by graff
in thread Debug code out of production systems by liz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (5)
    As of 2014-08-31 06:44 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (294 votes), past polls