Tainting and use lib...

B

Bryon Bean

Hi,

I was wondering if anyone could help me out with a problem that I'm
having while using the -T switch as well as a module that I've
written. The script works fine (below) until I add the -T switch to
it. When I look in the log files or compile at the command prompt I
get the "Can't locate RTG/Project.pm in @INC" even though the path to
Project.pm is right there in the "(@INC contains /path/to/my/mod
etc.)." I've looked through perlsec and lib to see if I could find
anything, but nothing. Has anyone experienced this. Any help is
greatly appreciated. Thanks

#!/usr/bin/perl -Tw

use strict;
use lib qw( /var/www/cgi-bin/war/RTG );
use RTG::project;
use CGI::Carp qw( fatalsToBrowser );

my $app = RTG::project->new();
$app->run; ## RTG::project is a sub-class of CGI::Application ##

-- snip [from cmd prompt] --

$ perl -cT project.cgi
Can't locate RTG/Project.pm in @INC (@INC contains:
/var/www/cgi-bin/war/RTG /usr/lib/perl5/5.8.0/cygwin-multi-64i
t /usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64int
/usr/lib/perl5/site_perl/5.8.0 /usr/lib/p
rl5/site_perl) at project.cgi line 7.
BEGIN failed--compilation aborted at project.cgi line 7.

-- snip --
 
B

Bryon Bean

Tina Mueller said:
so this lets us assume that there is a file
/var/www/cgi-bin/war/RTG/RTG/Project.pm

i think you probably want to write:
use lib qw( /var/www/cgi-bin/war );

Your absolutely right, this does work.
-T removes the current directory from @INC, so
before you used -T, it just worked because you had
"." in @INC, not because of the "use lib".

Is this documented anywhere? I thought that I had looked everywhere
for something that might explain this behavior?
hth, tina

This does help and thank you very much!
-Bryon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top