I think you don't need to worry about putting stuff in a BEGIN block as you've indicated -- I believe that mod_perl is clever enough to do what you want it to.

If you edit something, an old version of the script might still be in memory. Years ago I would do an apachectl graceful to get Apache to pay attention to the change I'd just made. Sometimes that wouldn't work, and I'd have to rename the file, press refresh a couple dozen times until I got the "Unknown module" error, then restore the file and continue testing.

I think you can still call exit as you're suggesting -- to stop execution of that instance of the code. But a test should be fairly easy to set up.

I wish I could provide more information, but my experience comes from a period of frantic web development in 1998-2000, and some more recent 'dabbling' that has re-introduced me to mod_perl without actually giving me time to get really familiar with it.

Good luck!

--t. alex
Life is short: get busy!

In reply to Re: Knowing what works with mod_perl by talexb
in thread Knowing what works with mod_perl by Coruscate

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.