perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hall, Philippe" <>
Subject RE: pwd is '/' ???
Date Thu, 27 May 2004 21:32:42 GMT
	Thanks for the information -- the [+ +] issue is a minor annoyance, but I can understand
the pure intentions behind it.  When you say chdir was disabled, is it advised, then, to just
use absolute paths for file I/O?  And why does this chdir change not apply to the Execute()
function -- or does it?  

Thanks for your patience -- I'm a pretty solid perl hacker, but Embperl's inner workings are
over my head in most cases.


-----Original Message-----
Sent: Thursday, May 27, 2004 5:17 PM
To: Hall, Philippe
Subject: Re: pwd is '/' ???

On Thu, 27 May 2004, Hall, Philippe wrote:

> Ok I'll say up front that this is my first time setting up EmbPerl 2
> and Apache 2, but I've used EmbPerl 1.3 for a few years now.  Here's
> my issue, which I just discovered about an hour ago:

I haven't moved to EmbPerl 2 yet, but I've been keeping an eye on its
issues, as I would like to do so with as little pain as possible.

> I have an .epl, subs.epl, which renders fine.  I have the following
> line of code that is dying:
> 	open (FILEHANDLE, 'sites.txt') or die 'Cannot open sites.txt: '.$!;
> And 'sites.txt' does exist in the same directory as subs.epl, and the
> permissions are all good.  The page dies and I get a file not found
> error from embperl.  So, to debug, I added the following line above my
> filehandle open:
> 	[- print OUT `pwd`; -]
> Strangely enough, my pwd is '/'.  Since I'm in the process of
> migrating from my old Embperl 1.3 box to this new box, I added the
> same print statement to the 1.3 counterpart of subs.epl. The pwd on
> that box is correct -- the directory containing  subs.epl (as
> expected).
> So does anyone know why I'm getting this behavior in Embperl 2.0?

chdir was removed for performance and cross-platform uniformity.  Note
that chdir did not happen on all platforms in 1.3, so this isn't a
change for everyone.

> Another thing I notice (but presumably unrelated): I can't have more
> than one statement in a [+ +] block any more... is that right?  I get
> a syntax error.

That is correct.

Apparently, the intention of [+ +] blocks is simple output; there were
some issues that were complicated by having complex statements, so
complex statements were disabled.  If you want to have a complex
statement, put it in a perl subroutine.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message