Re: Getting lots of redefined statements in the error_log

2005-06-21 Thread Perrin Harkins
On Tue, 2005-06-21 at 16:53 -0500, Boysenberry Payne wrote:
> I think this is my scenario.

In that case, fix your @INC and everything will be fine.  The problem
described here is not related to mod_perl.

> If one was set up as DSO and the other mod_perl wasn't would that
> make a huge difference in the way modules would run?

When do you see the errors?  It is when you do some kind of a restart?
Are you using Apache::Reload or Apache::StatINC?

- Perrin



Re: Getting lots of redefined statements in the error_log

2005-06-21 Thread Boysenberry Payne

I can duplicate it with the following simple example:

-- mod_perl.conf

PerlRequire conf/startup.pl


  SetHandler perl-script
  PerlResponseHandler MyHandler



-- startup.pl

use SomeDir::MyPackage;



-- /path/to/SomeDir/MyPackage.pm

package SomePackage;

sub foo { return 1; }

1;


-- /path/to/MyHandler.pm

require AnotherPackage;


-- /path/to/SomeDir/AnotherPackage.pm

package AnotherPackage;

use SomePackage;

1;

---

The end result is that %INC has entries:

   SomeDir/MyPackage.pm => /path/to/SomeDir/MyPackage.pm,
   MyPackage.pm => /path/to/SomeDir/MyPackage.pm

and my log file has

Subroutine foo redefined at /path/to/SomeDir/SomePackage.pm line 3






I think this is my scenario.

I'm using v5.8.1-RC3 built for darwin-thread-multi-2level, locally
and
v5.8.0 built for i386-linux-thread-multi, on my external server.

If one was set up as DSO and the other mod_perl wasn't would that
make a huge difference in the way modules would run?

Thanks,
Boysenberry

This message contains information that is confidential
and proprietary to Humaniteque and / or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.

http://www.habitatlife.com
The World's Best Site Builder



RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Perrin Harkins
On Mon, 2005-06-20 at 16:45 -0600, Aaron Scott wrote:
> I can duplicate it with the following simple example:
> 
> -- mod_perl.conf
> 
> PerlRequire conf/startup.pl
> 
> 
>   SetHandler perl-script
>   PerlResponseHandler MyHandler
> 
> 
> 
> -- startup.pl
> 
> use SomeDir::MyPackage;
> 
> 
> 
> -- /path/to/SomeDir/MyPackage.pm
> 
> package SomePackage;
> 
> sub foo { return 1; }
> 
> 1;
> 
> 
> -- /path/to/MyHandler.pm
> 
> require AnotherPackage;
> 
> 
> -- /path/to/SomeDir/AnotherPackage.pm
> 
> package AnotherPackage;
> 
> use SomePackage;
> 
> 1;
> 
> ---
> 
> The end result is that %INC has entries:
> 
>SomeDir/MyPackage.pm => /path/to/SomeDir/MyPackage.pm,
>MyPackage.pm => /path/to/SomeDir/MyPackage.pm
> 
> and my log file has
> 
> Subroutine foo redefined at /path/to/SomeDir/SomePackage.pm line 3

This example is kind of broken, but I'm guessing you meant to say "use
MyPackage" rather than "use SomePackage"?  And maybe "package
SomePackage;" was supposed to say "package SomeDir::MyPackage"?

The only way I can imagine this happening is if you put '.' in your @INC
in addition to '/path/to' and are this calling the same file by two
different names.  Of course that will redefine your subs.

Sorry if I'm misunderstanding, but this doesn't look like a mod_perl
issue to me.

- Perrin



RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Aaron Scott
 
> But those should be two totally separate files with separate package
> declarations at the top.  It doesn't make sense that there would be
any
> namespace collisions.
> 
> - Perrin

I can duplicate it with the following simple example:

-- mod_perl.conf

PerlRequire conf/startup.pl


  SetHandler perl-script
  PerlResponseHandler MyHandler



-- startup.pl

use SomeDir::MyPackage;



-- /path/to/SomeDir/MyPackage.pm

package SomePackage;

sub foo { return 1; }

1;


-- /path/to/MyHandler.pm

require AnotherPackage;


-- /path/to/SomeDir/AnotherPackage.pm

package AnotherPackage;

use SomePackage;

1;

---

The end result is that %INC has entries:

   SomeDir/MyPackage.pm => /path/to/SomeDir/MyPackage.pm,
   MyPackage.pm => /path/to/SomeDir/MyPackage.pm

and my log file has

Subroutine foo redefined at /path/to/SomeDir/SomePackage.pm line 3




RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Perrin Harkins
On Mon, 2005-06-20 at 16:04 -0600, Aaron Scott wrote:
> For a file /path/to/SomeDir/MyPackage.pm, if I 'use MyPackage;' in one
> file, then subsequently 'use SomeDir::MyPackage' in another file, the
> second 'use' generates redefined subroutine errors.

But those should be two totally separate files with separate package
declarations at the top.  It doesn't make sense that there would be any
namespace collisions.

- Perrin



RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Aaron Scott
> Huh?  Are you saying that MyPackage and SomeDir::MyPackage are somehow
> the same file?  Or that they actually declare the same package name?
Or
> don't declare any package name at all?
> 
> - Perrin

For a file /path/to/SomeDir/MyPackage.pm, if I 'use MyPackage;' in one
file, then subsequently 'use SomeDir::MyPackage' in another file, the
second 'use' generates redefined subroutine errors.

-Aaron





RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Perrin Harkins
On Mon, 2005-06-20 at 14:06 -0600, Aaron Scott wrote:
> FWIW, I've noticed redefined subroutine "errors" when I require a single
> package using two different statements.  E.g., 
> 
> --- File1.pm
> 
> use MyPackage;
> 
> --File2.pm
> 
> use SomeDir::MyPackage;
> 
> 
> 
> Loading File2 when File1 has already been loaded seemed to cause a
> redefined subroutine.

Huh?  Are you saying that MyPackage and SomeDir::MyPackage are somehow
the same file?  Or that they actually declare the same package name?  Or
don't declare any package name at all?

- Perrin



RE: Getting lots of redefined statements in the error_log

2005-06-20 Thread Aaron Scott
FWIW, I've noticed redefined subroutine "errors" when I require a single
package using two different statements.  E.g., 

--- File1.pm

use MyPackage;

--File2.pm

use SomeDir::MyPackage;



Loading File2 when File1 has already been loaded seemed to cause a
redefined subroutine.

---
Aaron Scott
Software Engineer 
Cymphonix -- Network Composer
Office: (801) 938-1500
http://www.cymphonix.com
 
> -Original Message-
> From: Martin Moss [mailto:[EMAIL PROTECTED]
> Sent: Monday, June 20, 2005 9:06 AM
> To: Boysenberry Payne; mod_perl
> Subject: Re: Getting lots of redefined statements in the error_log
> 
> Can you confirm you have the same version of Perl on
> both systems?
> 
> I've seen these errors on perl 5.8 after upgrading
> from perl 5.005
> 
> Marty
> 
> p.s. I still have them too, so any help with this
> issue would be useful to me too...
> 
> --- Boysenberry Payne <[EMAIL PROTECTED]>
> wrote:
> 
> > Here is a sample of a long list:
> >
> > [Fri Jun 17 15:17:19 2005] Unix.pm: Subroutine _cwd
> > redefined at
> >
> /usr/lib/perl5/5.8.0/i386-linux-thread-multi/File/Spec/Unix.pm
> > line
> > 470.
> > [Fri Jun 17 15:17:19 2005] Carp.pm: Subroutine
> > import redefined at
> > /usr/lib/perl5/5.8.0/CGI/Carp.pm line 289.
> >
> > This only happens on our external server (currently
> > being tested and
> > set up.)  I didn't set it up, otherwise I would
> > offer config settings.
> >
> > It doesn't happen on my local system when I run the
> > same script.  I'm
> > not sure why I'm getting all of these redefined
> > errors.
> > I thought maybe someone here would know what's going
> > on
> >
> > Thanks,
> > Boysenberry
> >
> > This message contains information that is
> > confidential
> > and proprietary to Humaniteque and / or its
> > affiliates.
> > It is intended only for the recipient named and for
> > the express purpose(s) described therein.
> > Any other use is prohibited.
> >
> > http://www.habitatlife.com
> > The World's Best Site Builder
> >
> >
> 
> 
> 
> 
> ___
> How much free photo storage do you get? Store your holiday
> snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com



Re: Getting lots of redefined statements in the error_log

2005-06-20 Thread Martin Moss
Can you confirm you have the same version of Perl on
both systems?

I've seen these errors on perl 5.8 after upgrading
from perl 5.005

Marty

p.s. I still have them too, so any help with this
issue would be useful to me too...

--- Boysenberry Payne <[EMAIL PROTECTED]>
wrote:

> Here is a sample of a long list:
> 
> [Fri Jun 17 15:17:19 2005] Unix.pm: Subroutine _cwd
> redefined at 
>
/usr/lib/perl5/5.8.0/i386-linux-thread-multi/File/Spec/Unix.pm
> line 
> 470.
> [Fri Jun 17 15:17:19 2005] Carp.pm: Subroutine
> import redefined at 
> /usr/lib/perl5/5.8.0/CGI/Carp.pm line 289.
> 
> This only happens on our external server (currently
> being tested and 
> set up.)  I didn't set it up, otherwise I would
> offer config settings.
> 
> It doesn't happen on my local system when I run the
> same script.  I'm 
> not sure why I'm getting all of these redefined
> errors.
> I thought maybe someone here would know what's going
> on
> 
> Thanks,
> Boysenberry
> 
> This message contains information that is
> confidential
> and proprietary to Humaniteque and / or its
> affiliates.
> It is intended only for the recipient named and for
> the express purpose(s) described therein.
> Any other use is prohibited.
> 
> http://www.habitatlife.com
> The World's Best Site Builder
> 
> 




___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com