[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: I'm doing something wrong??
From:       Ken Williams <ken () forum ! swarthmore ! edu>
Date:       1999-05-30 14:47:52
[Download RAW message or body]

This could happen for any number of reasons.  One way is if you delete entries
from %INC, then require() or use() them again.  That's what happens when you do
a quick restart of the server, or when you modify a script that has subroutines
in it.

Another way this could happen is if you've got symlinks or different paths to a
single source file.  Or two different source files that contain the same
subroutines.  Or different subroutines with the same name in the same package. 
Or....


Furthermore, I don't think you really want to structure your Perl code the way
you've got it.  I believe you want:

{
 package Foo;

 bunch of stuff +
 sub blah {
    .....
 }
} # end package Foo


Your Foo package is extending farther than you think it is.  Try fixing this
problem first, then if you still get the errors look at the above
possibilities.


michael@bizsystems.com (Michael) wrote:
>Running apache in single thread test mode with 
>use diagnostics;
>use strict;
>package Foo; {
>
>bunch of stuff +
>sub Foo::blah {
>.....
>}
>} # end package Foo
>
>
>on the second and subsequent run of the script I always get
>
>Subroutine Foo::blah redefined at
>        /usr/local/apache/htdocs/foobar.plx line 240 (#1)
>    
>    (W) You redefined a subroutine.  To suppress this warning, say
>    
>        {
>        local $^W = 0;
>        eval "sub name { ... }";
>        }
>
>The script is not altered and apache is STOPPED and STARTED fresh
>when/if the script is altered.
>why am I getting a message that the script has changed?
>I get this message for every subroutine in the package
>
>The docs indicate that this is caused by altering and reusing the script 
>without "cleaning" the mod_perl space, this is not the case.
>
>Michael
>

  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic