Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

problems with switching off params::validate in mod_perl

by david2008 (Scribe)
on Jun 18, 2014 at 12:39 UTC ( #1090302=perlquestion: print w/ replies, xml ) Need Help??
david2008 has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I am using params::validate and want to switch it off in production where i use it with apache httpd and mod_perl.
I set in the .cshrc.config PERL_NO_VALIDATION to 1.
Afterwards in the local_httpd.config i use PassEnv PERL_NO_VALIDATION
The parameter is passed well as i can verify it with warn $ENV{PERL_NO_VALIDATION}.

Unfortunately i get the error:
The 'x' parameter (undef) to Y::foo was an 'undef', which is not one o +f the allowed types: scalar at line 70. ... ModPerl::ROOT::ModPerl::Registry::z_2ecgi::handler('Apache2::Reque +stRec=SCALAR(0xb61b6a8)') called at ... eval {...} called at ... ModPerl::RegistryCooker::run('ModPerl::Registry=HASH(0xb6360c8)') +called at ... ModPerl::RegistryCooker::default_handler('ModPerl::Registry=HASH(0 +xb6360c8)') called at ... ModPerl::Registry::handler('ModPerl::Registry', 'Apache2::RequestR +ec=SCALAR(0xb61b6a8)') called at -e line 0 eval {...} called at -e line 0
When i run the same cgi through command line everything works fine.
What is wrong here?

Comment on problems with switching off params::validate in mod_perl
Download Code
Re: problems with switching off params::validate in mod_perl
by Corion (Pope) on Jun 18, 2014 at 12:42 UTC

    You don't show us the relevant code, so we don't know if there is an error in your program logic.

    My guess is that you didn't restart the (correct instance of) Apache webserver and it still has an old version of the environment where PERL_NO_VALIDATION is not set.

    Note that the environment of the Apache webserver may well be different from your login environment as normal user.

    Personally, I would look at setting that environment variable in the HTTP configuration for your script/website instead of setting it globally for the Apache user.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1090302]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2014-08-28 04:50 GMT
Find Nodes?
    Voting Booth?

    The best computer themed movie is:

    Results (256 votes), past polls