perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject RE: changing to working directory of embperl files in 2.0?
Date Sun, 22 Aug 2004 13:20:58 GMT
> 
> Hi, I'm using Embperl 2.0 under Debian.  I just switched from 
> 1.3.  Is there a way to get the old behavior of having 
> Embperl switch into the working directory of a file that it processes?
> 

$epreq -> commponent -> cwd

returns the directory of the source file


> My problem is that I like to use perl modules from the same 
> directory as the file and this won't work now:
>   [- use SuperTable; # SuperTable.pm is in same dir as html file -]
> 

As long as you module doesn't import anything you can use requiree

[-
require $epreq -> commponent -> cwd . 'SuperTable.pm' ;
-]

Or if you like to use use, make a chdir

[!
BEGIN { chdir $epreq -> commponent -> cwd } 
use SuperTable ;
!]

Of couse you can also put the directory SuperTable.pm is in, into your perl
search path on server startup e.g.

use lib qw{/path/to/modules} ;


Gerald



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message