embperl and require>I'm pretty new to embperl. I noticed a behavior that is
>different from that of perl. When I use [- require('somefile.pl') -]
>in an embperl script, I get "Error in Perl code: Can't locate config.pl in
@INC
>" where @INC contains the current directory '.' and my script that calls
require
>is in the same directory as somefile.pl. This works as a perl cgi but not
in embperl.
>Can anyone explain to me why this doesn't work? I'm running embperl 2 on
mod_perl
Embperl 2 does not change to the diretory of the script. You can get the
directory with
$r -> component -> cwd ;
where $r is the Embperl request record which you get when you write
$r = shift ;
at the top of your page. So
[-
$r = shift ;
require $r -> component -> cwd . '/somefile.pl' ;
-]
Does what you want.
Gerald
--------------------------------------------------------------
Gerald Richter ecos electronic communication services gmbh
IT-Securityl�sungen * dynamische Webapplikationen * Consulting
Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice: +49 6133 939-122
WWW: http://www.ecos.de/ Fax: +49 6133 939-333
--------------------------------------------------------------
|
| ECOS BB-5000 Firewall- und IT-Security Appliance: www.bb-5000.info
|
+-------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]