PerlRun Subroutine redefine warnings

Hi,
I am running mod_perl/2.0.4 on Linux , I keep getting the subroutine
redefined warnings. Perlrun reloads the cgi on each request so why do
I keep getting these warnings ? Is there any other way to avoid this
other than no warnings qw/redefine/ in my scripts. Am I missing
something here ?.

Here is a minimal script I tested with

#!/usr/bin/perl
use strict;
use warnings;
print "Content-type:text/html \n\n";

test();
test();


sub test {
print " in test \n";
}

and here is my httpd.conf

PerlModule ModPerl::PerlRun
<Location /cgi-bin>
SetHandler perl-script
PerlHandler ModPerl::PerlRun
PerlSetVar ReloadAll Off

PerlResponseHandler +ModPerl::PerlRun
PerlOptions +ParseHeaders
PerlSendHeader On
Options +ExecCGI
</Location>
PerlRequire "/opt/nms/www/cgi-bin/startup.pl"
# I modify [at] INC in startup.pl and do not load any modules

Error in the error_log
Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 22.
Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 10.

Thanks,
Kiran
kiran kumar [ Do, 27 August 2009 02:07 ] [ ID #2013782 ]

Re: PerlRun Subroutine redefine warnings

This error occurs when you have two subroutines with the same name.


Mike O'Krongli
President and CTO
Acorg Inc
519 432-1185
----- Original Message -----
From: "Kiran Kumar" <mkirank1 [at] gmail.com>
To: <modperl [at] perl.apache.org>
Sent: Wednesday, August 26, 2009 8:07 PM
Subject: PerlRun Subroutine redefine warnings


> Hi,
> I am running mod_perl/2.0.4 on Linux , I keep getting the subroutine
> redefined warnings. Perlrun reloads the cgi on each request so why do
> I keep getting these warnings ? Is there any other way to avoid this
> other than no warnings qw/redefine/ in my scripts. Am I missing
> something here ?.
>
> Here is a minimal script I tested with
>
> #!/usr/bin/perl
> use strict;
> use warnings;
> print "Content-type:text/html \n\n";
>
> test();
> test();
>
>
> sub test {
> print " in test \n";
> }
>
> and here is my httpd.conf
>
> PerlModule ModPerl::PerlRun
> <Location /cgi-bin>
> SetHandler perl-script
> PerlHandler ModPerl::PerlRun
> PerlSetVar ReloadAll Off
>
> PerlResponseHandler +ModPerl::PerlRun
> PerlOptions +ParseHeaders
> PerlSendHeader On
> Options +ExecCGI
> </Location>
> PerlRequire "/opt/nms/www/cgi-bin/startup.pl"
> # I modify [at] INC in startup.pl and do not load any modules
>
> Error in the error_log
> Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 22.
> Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 10.
>
> Thanks,
> Kiran
>
Mike OK [ Do, 27 August 2009 03:20 ] [ ID #2013783 ]

Re: PerlRun Subroutine redefine warnings

Hi Mike,
Thanks for your reply, If you check my script there is no other
subroutine with the same name and I do not import any modules , I
renamed the subroutine to foo and I still get the same warnings.


Thanks,
Kiran


On Wed, Aug 26, 2009 at 8:20 PM, Mike OK<mike [at] acorg.com> wrote:
> This error occurs when you have two subroutines with the same name.
>
> Mike O'Krongli
> President and CTO
> Acorg Inc
> 519 432-1185
> ----- Original Message ----- From: "Kiran Kumar" <mkirank1 [at] gmail.com>
> To: <modperl [at] perl.apache.org>
> Sent: Wednesday, August 26, 2009 8:07 PM
> Subject: PerlRun Subroutine redefine warnings
>
>
>> Hi,
>> =A0I am running mod_perl/2.0.4 on Linux , I keep getting the subroutine
>> redefined warnings. Perlrun reloads the cgi on each request so why do
>> I keep getting these warnings ? Is there any other way to avoid this
>> other than no warnings qw/redefine/ in my scripts. Am I missing
>> something here ?.
>>
>> =A0Here is a minimal script I tested with
>>
>> #!/usr/bin/perl
>> use strict;
>> use warnings;
>> print "Content-type:text/html \n\n";
>>
>> test();
>> test();
>>
>>
>> sub test {
>> print " in test \n";
>> }
>>
>> =A0and here is my httpd.conf
>>
>> =A0 =A0 =A0 =A0PerlModule ModPerl::PerlRun
>> =A0 =A0 <Location /cgi-bin>
>> =A0 =A0 =A0 =A0 SetHandler perl-script
>> =A0 =A0 =A0 =A0 PerlHandler ModPerl::PerlRun
>> =A0 =A0 =A0 =A0 PerlSetVar ReloadAll Off
>>
>> =A0 =A0 =A0 =A0 PerlResponseHandler +ModPerl::PerlRun
>> =A0 =A0 =A0 =A0 PerlOptions +ParseHeaders
>> =A0 =A0 =A0 =A0 PerlSendHeader On
>> =A0 =A0 =A0 =A0 Options +ExecCGI
>> =A0 =A0 </Location>
>> =A0 =A0 PerlRequire "/opt/nms/www/cgi-bin/startup.pl"
>> =A0 =A0 # I modify [at] INC in startup.pl and do not load any modules
>>
>> Error in the error_log
>> Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 22.
>> Subroutine test redefined at /opt/nms/www/cgi-bin/test1.pl line 10.
>>
>> Thanks,
>> Kiran
>>
>
>
kiran kumar [ Do, 27 August 2009 16:55 ] [ ID #2013786 ]

Re: PerlRun Subroutine redefine warnings

Kiran Kumar wrote:
> Hi Mike,
> Thanks for your reply, If you check my script there is no other
> subroutine with the same name and I do not import any modules , I
> renamed the subroutine to foo and I still get the same warnings.
>

There's an old thread from someone else reporting this, though it
doesn't have any sort of resolution.

http://marc.info/?t=93783022000001&r=1&w=2

Theoretically, while running under PerlRun that shouldn't happen.

Adam
Adam Prime [ Do, 27 August 2009 17:58 ] [ ID #2013789 ]
Webserver » gmane.comp.apache.mod-perl » PerlRun Subroutine redefine warnings

Vorheriges Thema: redirect mod_perl install
Nächstes Thema: mod_perl on win32