http://www.perlmonks.org?node_id=624593

monkfan has asked for the wisdom of the Perl Monks concerning the following question:

Dear all,
Running this piece of code is never a problem in Apache 1.3.
#!/usr/bin/perl use CGI qw/:standard :html3/; use CGI::Carp qw( fatalsToBrowser ); $CGI::POST_MAX=1024 * 100; # max 100K posts1 BEGIN { if ( $ENV{PERL5LIB} and $ENV{PERL5LIB} =~ /^(.*)$/ ) { # Blindly untaint. Taintchecking is to protect # from Web data; # the environment is under our control. eval "use lib '$_';" foreach ( reverse split( /:/, $1 ) ); } } use Acme::Spork; use Bio::Tools::GuessSeqFormat; print "Content-type: text/html\n\n"; print "Hello World !! It works.\n";
It can recognize the path as set in .htaccess below:
SetEnv PERL5LIB /home/monkfan/lib/perl5/site_perl/5.8.5/i386-linux-th +read-multi:/home/monkfan/lib/perl5/site_perl/5.8.5
Then I upgraded from Apache 1.3 to 2.2 on the same Linux box. But now with Apache 2.2, it can't locate the location of those modules as set in the identical htaccess.

Does anybody has experience of setting PERL5LIB for htaccess in Apache 2.2? How can I resolve the problem above?

Regards,
Edward