Well, I've read up a little on Python (easy, easy... I didn't come here to start a langauge war), and one thing I've noticed a lot in their teachings, is in files that are meant for including in other files have a little something at the bottom of the code that goes something like:

if __package__ eq __main__: # do stuff to test to see if package is working.
(elaboration '(the young monk is easily excited) '(I would like to be able to do this with perl as well as Python. The solution...)) I would guess it would be one of:
if($main == "hardcoded::package::name") { } if($main == $PROGRAM_NAME) { } if($main->isa("hardcoded::package::name")) { }
However, I am sure all of those are flawed. I am also sure t here is a better way to "emulate" what Python programmers do in perl. For those of you unfamilure with this proramming practice, it is done so each portion of a project can be tested indepedandtly. However the same code that tests it, does not get ran when it is included. Now, as far as I am concerned running:
$debug && print "some code"; $debug && print "some more code"
As that is just messy. This would make debugging my stuff a lot easier. Thank you kindly

In reply to Self Testing Modules by Sheol

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.