Is this not a current-working-directory issue?

This isn't terribly well documented on the mod_perl site, but from 
http://perl.apache.org/docs/2.0/api/ModPerl/Registry.html


        META: document that for now we don't chdir() into the script's
        dir, because it affects the whole process under threads.
        ModPerl::RegistryPrefork should be used by those who run only
        under prefork MPM.
        
Try using absolute paths for 'use lib', instead of : use lib './lib' 

clint

On Fri, 2008-08-29 at 10:53 -0400, Berg, Eric wrote:
> Jeff,
> 
> I'm running into issues with mod_perl2 that sound like they may be
> related.  Are you, in fact, running this script under mod_perl?  Doesthe
> myttt.tmpl file that you refer to contain Perl code that is to be
> eval'ed in your myscr.pl?
> 
> Just yesterday I ran into a problem in which using do( $file ) or eval(
> $file ) both had problems in that they did not successfully execute the
> code in $file.
> 
> Does that sound like your problem?
> 
> Folks, is there some kind of setting for mod_perl2 that affects this, or
> a different way to accomplish this?
> 
> Eric
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On 
> > Behalf Of Sean Davis
> > Sent: Friday, August 29, 2008 10:05 AM
> > To: Jeff Pang
> > Cc: modperl perl apache org
> > Subject: Re: a require problem
> > 
> > On Fri, Aug 29, 2008 at 9:54 AM, Jeff Pang <[EMAIL PROTECTED]> wrote:
> > > I have began a project, but meet some problems,:)
> > >
> > > say there are three dirs:
> > >
> > > |- cgi-bin
> > > |- cgi-bin - lib
> > > |- cgi-bin - template
> > >
> > >
> > > I have a script in cgi-bin, which requires the template 
> > file from template
> > > dir.
> > > This script also uses a library file (.pm) from lib dir.
> > > Finally the library need to require the former template file too.
> > >
> > > say the script is myscr.pl, the lib file is mylib.pm, the 
> > template file is
> > > myttt.tmpl.
> > >
> > > so in myscr.pl:
> > >
> > > use lib './lib';
> > > use mylib;
> > > require 'template/myttt.tmpl';
> > >
> > >
> > > in mylib.pm:
> > >
> > > require '../template/myttt.tmpl';
> > >
> > >
> > > When I execute "perl mysrc.pl", it can't run, saying the routines in
> > > myttt.tmpl can't be found.
> > 
> > Hi, Jeff.  This list is for mod_perl development, not CGI.  That said,
> > you'll need to read the documentation for the template engine (which
> > one are you using?) that you are using.  I doubt that you want to
> > simply "require" them in your script like this.
> > 
> > Sean
> > 

Reply via email to