# how to disable perl warnings in apache?

## turtles

Greetings all.

I have two very similar Gentoo setups running apache and I am testing a web application that uses perl via mod_cgi.

I am unable to turn off Perl warnings printed to the browser on one of the setups, the other seems identical and is fine.

I actually 'diffed' the entire apache config directory on both and they are quite similar. Nothing fancy.

Both setups have a similar configuration file that calls the perl like so:

```

 <Directory /var/www/localhost/htdocs/testing/>

   AllowOverride All

   AddHandler cgi-script .pl

   Options ExecCGI Includes FollowSymlinks

   Require all granted

</Directory>

```

Setup A is fine running apache 2.4.18 and is 64 bit.

Setup B is having the problem running 2.4.18-r1 is 32 bit.

They both have the same USE flags other than "-proxy_html" on setup B

If I do a 

```
grep -r 'proxy_html' /etc/portage/
```

I don't get a match so it just be a Gentoo setting?

Both systems are on a recent Perl:

```

perl -v

This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux-thread-multi

(with 30 registered patches, see perl -V for more detail)
```

On Setup B I am unable to turn "off" Perl warnings, even if I add 

```
no warnings;
```

to the file that invokes Perl!

Looking here but don't see anything:

http://httpd.apache.org/docs/current/mod/mod_cgi.html

Any thoughts?

Thank you in advance

----------

## Hu

Why not fix the warnings?  Generally, Perl warnings are not spurious, so fixing them might lead to better code.

----------

## turtles

 *Hu wrote:*   

> Why not fix the warnings?  Generally, Perl warnings are not spurious, so fixing them might lead to better code.

 

Of course I will and I do. However I can only work so many hours in a day and I need to switch the 'B' system over to production use for a while. And i should be able to turn warnings off according to perldoc.

I do however consider "Use of uninitialized value in new" a spurious warning,

when it is just the application feeding the 'empty string' or a zero to a function.

Is it not  odd that 

```
no warnings;

$^W = 0;
```

 does not turn warnings off?

--cheers

Turtle

----------

