wfsp has asked for the wisdom of the Perl Monks concerning the following question:
And a script...#!/usr/bin/perl -T package CWI::Message; use warnings; use strict; use CGI::Carp qw(fatalsToBrowser); use Exporter; use vars qw( $VERSION @ISA @EXPORT ); $VERSION = 1.00; @ISA = qw( Exporter ); @EXPORT = qw( &get_msg ); sub get_msg{ return 'message from module' } 1;
I haven't use taint here, I think it kicks up over the $ENV variable. When I hard code the path the result is the same.#!/usr/bin/perl use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); my $path; BEGIN { $path = $ENV{ DOCUMENT_ROOT } . '/z_cwi_cgi' } use lib $path; use CWI::Message; # works as expected my $msg = ''; # 'Undefined subroutine &main::get_msg' #$msg = get_msg(); print <<HTML; Content-type: text/html <html><head><title>Module test</title></head><body> <p>test_mod.cgi</p> <p>$path</p> <p>$msg</p> <p>back in test_mod.cgi</p> </body></html> HTML
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple module crashes on remote server
by tinita (Parson) on Jul 13, 2004 at 10:57 UTC | |
by wfsp (Abbot) on Jul 13, 2004 at 12:04 UTC | |
|
Re: Simple module crashes on remote server
by Chady (Priest) on Jul 13, 2004 at 10:18 UTC | |
by wfsp (Abbot) on Jul 13, 2004 at 10:46 UTC |