migrating to 2.0 and getting tons of warnings
migrating to 2.0 and getting tons of warnings
am 26.02.2009 21:04:27 von Matthew Lenz
I can't seem to disable warnings on our production environment. 'use
warnings' is not included in any of the config/startup/scripts or custom
modules. Its possible I guess that its being used by a CPAN module.
We had a system on Debian 3.1 (apache/mod_perl 1.x)and I have been doing
work to migrate the app to Debian 5.0 (apache/mod_perl 2).
I don't mine the extra log data in development and intend to fix these
issues but I can't have these '-e: Use of uninitialized value' cramming
up my production log files.
I've tried everything I can think of, anyone have any ideas?
Re: migrating to 2.0 and getting tons of warnings
am 26.02.2009 21:36:13 von aw
Matthew Lenz wrote:
> I can't seem to disable warnings on our production environment. 'use
> warnings' is not included in any of the config/startup/scripts or custom
> modules. Its possible I guess that its being used by a CPAN module.
>
> We had a system on Debian 3.1 (apache/mod_perl 1.x)and I have been doing
> work to migrate the app to Debian 5.0 (apache/mod_perl 2).
>
> I don't mine the extra log data in development and intend to fix these
> issues but I can't have these '-e: Use of uninitialized value' cramming
> up my production log files.
>
> I've tried everything I can think of, anyone have any ideas?
>
If you are talking about cgi-bin scripts, then they probably all start
with a line like
#!/usr/bin/perl -w
Removing the -w would do it.
But the warnings themselves mean something that you'd better not ignore.
To remove the -w, you could even use a perl one-liner, such as
perl -pi'.bak' -e 's/^#!\/usr\/bin\/perl -w/#!\/usr\/bin\/perl/' *.pl
... but try this first on a limited set somewhere !!!
Re: migrating to 2.0 and getting tons of warnings
am 26.02.2009 21:49:30 von Adam Prime
André Warnier wrote:
> Matthew Lenz wrote:
>> I can't seem to disable warnings on our production environment. 'use
>> warnings' is not included in any of the config/startup/scripts or custom
>> modules. Its possible I guess that its being used by a CPAN module.
>>
>> We had a system on Debian 3.1 (apache/mod_perl 1.x)and I have been doing
>> work to migrate the app to Debian 5.0 (apache/mod_perl 2).
>>
>> I don't mine the extra log data in development and intend to fix these
>> issues but I can't have these '-e: Use of uninitialized value' cramming
>> up my production log files.
>>
>> I've tried everything I can think of, anyone have any ideas?
>>
>
> If you are talking about cgi-bin scripts, then they probably all start
> with a line like
> #!/usr/bin/perl -w
>
> Removing the -w would do it.
> But the warnings themselves mean something that you'd better not ignore.
>
> To remove the -w, you could even use a perl one-liner, such as
>
> perl -pi'.bak' -e 's/^#!\/usr\/bin\/perl -w/#!\/usr\/bin\/perl/' *.pl
>
> .. but try this first on a limited set somewhere !!!
>
Another thing to check is if you've got
PerlSwitches -w
in your httpd.conf, that'll turn on warnings too.
Adam
Re: migrating to 2.0 and getting tons of warnings
am 26.02.2009 22:01:51 von Matthew Lenz
On Thu, 2009-02-26 at 15:49 -0500, Adam Prime wrote:
> André Warnier wrote:
> > Matthew Lenz wrote:
> >> I can't seem to disable warnings on our production environment. 'use
> >> warnings' is not included in any of the config/startup/scripts or custom
> >> modules. Its possible I guess that its being used by a CPAN module.
> >>
> >> We had a system on Debian 3.1 (apache/mod_perl 1.x)and I have been doing
> >> work to migrate the app to Debian 5.0 (apache/mod_perl 2).
> >>
> >> I don't mine the extra log data in development and intend to fix these
> >> issues but I can't have these '-e: Use of uninitialized value' cramming
> >> up my production log files.
> >>
> >> I've tried everything I can think of, anyone have any ideas?
> >>
> >
> > If you are talking about cgi-bin scripts, then they probably all start
> > with a line like
> > #!/usr/bin/perl -w
> >
> > Removing the -w would do it.
> > But the warnings themselves mean something that you'd better not ignore.
> >
> > To remove the -w, you could even use a perl one-liner, such as
> >
> > perl -pi'.bak' -e 's/^#!\/usr\/bin\/perl -w/#!\/usr\/bin\/perl/' *.pl
> >
> > .. but try this first on a limited set somewhere !!!
> >
>
> Another thing to check is if you've got
>
> PerlSwitches -w
>
> in your httpd.conf, that'll turn on warnings too.
>
> Adam
I have no 'use warnings' anywhere in my code/config. I have no shebangs
with -w/W anywhere.
I did however, JUST figure it out:
PerlSwitches -X
That's the only thing that would work and honestly its highly
undesirable. The crazy thing is that ModPerl::RegistryCooker seems to
expend a lot of time making damn well sure that it respects the scripts
warnings settings.
Maybe the debian guys did something goofy with the modules. It wouldn't
be the first time. That or maybe its just a bug in ModPerl. Even if
some CPAN module out there has 'use warnings;' in it that shouldn't have
any affect on any code outside of its own package should it?
Re: migrating to 2.0 and getting tons of warnings
am 26.02.2009 22:30:33 von Adam Prime
> Maybe the debian guys did something goofy with the modules. It wouldn't
> be the first time. That or maybe its just a bug in ModPerl. Even if
> some CPAN module out there has 'use warnings;' in it that shouldn't have
> any affect on any code outside of its own package should it?
I think that Moose and Modern::Perl do something fancy to globally turn
on both strict and warnings, but aside from that I have no idea off hand.
Adam
Re: migrating to 2.0 and getting tons of warnings
am 26.02.2009 23:17:38 von Perrin Harkins
On Thu, Feb 26, 2009 at 4:01 PM, Matthew Lenz wrote=
:
> Maybe the debian guys did something goofy with the modules. =A0It wouldn'=
t
> be the first time. =A0That or maybe its just a bug in ModPerl. =A0Even if
> some CPAN module out there has 'use warnings;' in it that shouldn't have
> any affect on any code outside of its own package should it?
Something could be setting $^W. Grep your code for that.
- Perrin
Re: migrating to 2.0 and getting tons of warnings
am 27.02.2009 13:58:42 von Matthew Lenz
On Thu, 2009-02-26 at 17:17 -0500, Perrin Harkins wrote:
> On Thu, Feb 26, 2009 at 4:01 PM, Matthew Lenz wrote:
> > Maybe the debian guys did something goofy with the modules. It wouldn't
> > be the first time. That or maybe its just a bug in ModPerl. Even if
> > some CPAN module out there has 'use warnings;' in it that shouldn't have
> > any affect on any code outside of its own package should it?
>
> Something could be setting $^W. Grep your code for that.
I only found a single reference to $^W and it was setting it to 0 for a
small block of code. It didn't really even need to do so as no code was
enabling them.
This same code is going from Debian 3.1 (apache 1, mod_perl 1, perl 5.8)
to Debian 5.0 (apache 2, mod_perl 2, perl 5.10) and now I'm getting the
warnings.
I looked through the packge diff:
http://ftp.de.debian.org/debian/pool/main/liba/libapache2-mo d-perl2/libapache2-mod-perl2_2.0.4-5.diff.gz
and didn't spot any changes that would have this affect.
> - Perrin
Re: migrating to 2.0 and getting tons of warnings
am 27.02.2009 17:29:48 von Perrin Harkins
On Fri, Feb 27, 2009 at 7:58 AM, Matthew Lenz wrote:
> I looked through the packge diff:
>
> http://ftp.de.debian.org/debian/pool/main/liba/libapache2-mo d-perl2/libapache2-mod-perl2_2.0.4-5.diff.gz
>
> and didn't spot any changes that would have this affect.
What about other CPAN modules you're using. Do you use a framework
like Mason? You probably have different versions on the newer
machine.
- Perrin
Re: migrating to 2.0 and getting tons of warnings
am 27.02.2009 17:43:03 von Matthew Lenz
On Fri, 2009-02-27 at 11:29 -0500, Perrin Harkins wrote:
> On Fri, Feb 27, 2009 at 7:58 AM, Matthew Lenz wrote:
> > I looked through the packge diff:
> >
> > http://ftp.de.debian.org/debian/pool/main/liba/libapache2-mo d-perl2/libapache2-mod-perl2_2.0.4-5.diff.gz
> >
> > and didn't spot any changes that would have this affect.
>
> What about other CPAN modules you're using. Do you use a framework
> like Mason?
No, this is just a legacy app that runs straight CGI's via
ModPerl::RegistryPrefork
> You probably have different versions on the newer
> machine.
Absolutely, I'm guessing nearly every CPAN module being used is updated.
> - Perrin
I thought that if a package does a 'use warnings;' that it only affects
code being executed in that package? Maybe that is not the case under
mod perl 2? mod perl 1 didn't exhibit that behavior.
Re: migrating to 2.0 and getting tons of warnings
am 27.02.2009 17:49:11 von Perrin Harkins
On Fri, Feb 27, 2009 at 11:43 AM, Matthew Lenz wrot=
e:
> No, this is just a legacy app that runs straight CGI's via
> ModPerl::RegistryPrefork
I'd check for any $^W manipulation in ModPerl::RegsitryPrefork.
> I thought that if a package does a 'use warnings;' that it only affects
> code being executed in that package? =A0Maybe that is not the case under
> mod perl 2?
It's still the case. mod_perl doesn't change anything about the
behavior of perl, just the lifecycle of your scripts.
- Perrin