For a long time, I've put up with either Mod_Perl or some sort of Apache2::Reload problem. It seems that I cannot get the configuration correct. I seriously need some wisdom.

My problem is that if I change a perl module, I get "Internal Server" errors on the screen and in the error log I get things like:

maybe use strict error: Subroutine new redefined at Item.pm line 13

Refreshing the page a few times and eventually the "cache" clears. Most of the time refreshing very quickly gives me this:

Attempt to reload Item.pm aborted. <--> Compilation failed in require at (eval 109) line 3

I am using Mod_Perl and CGI together -- I've also attempted to use Apache2::Reload which claims to "Fix" this problem. In my httpd.conf file I have these, like the module suggests:

PerlModule Apache2::Reload PerlInitHandler Apache2::Reload

In a development situation I want my perl modules to be checked and recomplied the moment I make a new change, I dont really care about performance when I'm constantly making changes and getting the code layed down.

Anyway -- I hope someone out there has a proper answer for this. I love developing in Perl/CGI, its gotten me some awesome results. But moving to PM files and OO is becoming a struggle when my Perl modules are constantly acting up. Any suggestions are extremely welcome.

Thanks!!


In reply to Perl Modules - Mod_Perl and CGI by Trihedralguy

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.