Re: a require problem
am 29.08.2008 16:04:35 von Sean Davis
On Fri, Aug 29, 2008 at 9:54 AM, Jeff Pang 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
RE: a require problem
am 29.08.2008 16:53:11 von eric.berg
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( =24file ) or eval(
=24file ) both had problems in that they did not successfully execute the
code in =24file.
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: seandavi=40gmail.com =5Bmailto:seandavi=40gmail.com=5D On=20
> 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
>=20
> On Fri, Aug 29, 2008 at 9:54 AM, Jeff Pang wrote:
> > I have began a project, but meet some problems,:)
> >
> > say there are three dirs:
> >
> > =7C- cgi-bin
> > =7C- cgi-bin - lib
> > =7C- cgi-bin - template
> >
> >
> > I have a script in cgi-bin, which requires the template=20
> 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=20
> 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 =22perl mysrc.pl=22, it can't run, saying the routines in
> > myttt.tmpl can't be found.
>=20
> 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 =22require=22 them in your script like this.
>=20
> Sean
>=20
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - =
- - - - - - -
This message is intended only for the personal and confidential use of the =
designated recipient(s) named above. If you are not the intended =
recipient of this message you are hereby notified that any review, =
dissemination, distribution or copying of this message is strictly =
prohibited. This communication is for information purposes only and =
should not be regarded as an offer to sell or as a solicitation of an =
offer to buy any financial product, an official confirmation of any =
transaction, or as an official statement of Lehman Brothers. Email =
transmission cannot be guaranteed to be secure or error-free. Therefore, =
we do not represent that this information is complete or accurate and it =
should not be relied upon as such. All information is subject to change =
without notice.
--------
IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within =
this communication (including any attachments) is not intended or written =
to be used and cannot be used for the purpose of (i) avoiding U.S. tax =
related penalties or (ii) promoting, marketing or recommending to another =
party any transaction or matter addressed herein.