Greetings Monks,

I am having a problem with Apache::Reload, which is really more of an annoyance, but nonetheless:

I've written a couple of classes to encapsulate some configuration and path information, they inherit from a class that's declared roughly like this:

use base qw(Class::Accessor Class::Fields); use fields qw(id dir_base url_base dir_tmp conf); __PACKAGE__->mk_accessors(__PACKAGE__->show_fields('Public'));

The inheriting class would be along the lines of:

use base qw(My::Abstract::Class); use fields qw(dir blast_input blast_output t_result_thumb t_result_ima +ge t_region_thumb t_mview t_mview_thumb t_parsed_result); use fields qw(temp_out temp_in); use fields qw(url blast_output_url t_result_thumb_url t_result_image_u +rl t_region_thumb_url t_mview_thumb_url); __PACKAGE__->mk_accessors(__PACKAGE__->show_fields('Public'));

The actual problem is similar to the old "function redefined" warnings when running under Apache::Reload - it occurs when the module changes (ie A::R has to recompile it), and doesn't appear in production when running without A::R.

The difference is that rather than a simple warning I get

Field name 'temp_out' already in use at /usr/lib/perl5/5.6.1/fields.pm + line 34 BEGIN failed--compilation aborted at My::Config::Thing line 14. Compilation failed in require at /usr/lib/perl5/site_perl/5.6.1/Apache +/Reload.pm line 132.

So, two questions:
1. This goes away without Reload.pm, so I am guessing it's not really a problem? But it is annoying because I am back to restarting apache after every change - is there a way to get around this?
2. Why 'temp_out'? I would expect it to choke on the first field that's declared. Any ideas?


In reply to mod_perl, Apache::Reload and Class::Fields by glwtta

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.