OK then, what does this script print?
#!perl use Cwd; print "Content-type: text/plain\r\n\r\n"; print "Cwd=".cwd()."\n"; print "\@INC=('" . join("', '", @INC)."')\n"; eval "use lib qw(./lib);"; print "\@INC after use lib=('" . join("', '", @INC)."')\n"; eval "use Field;"; if ($@) { print "Failed to use Field.pm: $@\n"; } else { print "Field.pm loaded from $ENV{'Field.pm'}\n"; }
The reason why you should not put the modules in cgi-bin is that you most likely do not want people to download or execute them, do you? If your scripts are to be installed in $foo/cgi-bin then the libraried may well be in $foo/lib. Thus you'd just use lib qw(../lib); instead. Or maybe rather use Cwd;use lib cwd()."/../lib"; to be safe in case you change the working directory and try to import some more modules later.
In reply to Re^3: MS Frontpage, _vti_cnf directories and perllibs
by Jenda
in thread MS Frontpage, _vti_cnf directories and perllibs
by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |