perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cameron B. Prince" <cpri...@rideware.com>
Subject RE: If -f Before Execute
Date Sat, 27 Sep 2003 20:03:27 GMT
I guess a better way to ask my question is:

Is there an environment variable available within Embperl that contains the
true filesystem path to the current page that's being called? If so, I could
simply remove the filename from it with a regex and replace with the file
I'm testing for existence.

I don't want to hardcode a path such as your example.

Thanks,
Cameron

> -----Original Message-----
> From: edgrimm@dsblade00.wat.us.ray.com
> [mailto:edgrimm@dsblade00.wat.us.ray.com]
> Sent: Friday, September 26, 2003 7:58 PM
> To: Cameron B. Prince
> Cc: embperl@perl.apache.org
> Subject: Re: If -f Before Execute
>
>
> 1. It better be clear what the current working directory is,
> if you are
> going to depend on it.
> 2. What it is depends upon whether chdir is supported in your Apache
> platform, IIRC.
>
> Note that I am using 1.x still, so Execute is, in fact, part of
> HTML::Embperl.  Also note that my real code uses chdir; this is merely
> an example that doesn't.
>
>   [- $dir = '/usr/local/WWW.codepages';
>      $subpage = ${$rec}{type} . '.epl';
>      if (! -f "$dir/$subpage") {
> 	 $subpage = 'default.epl';
>      } -]
>   [- HTML::Embperl::Execute({ inputfile => "$dir/$subpage",
>                             escmode => 0 }); -]
>
> Ed
>
> On Fri, 26 Sep 2003, Cameron B. Prince wrote:
>
> > Hi,
> >
> > Does anyone have an example of a way to do a file existence
> test before
> > executing a file to include? It's not clear to me what the
> current working
> > directory is.
> >
> > Thanks,
> > Cameron
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> > For additional commands, e-mail: embperl-help@perl.apache.org



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


Mime
View raw message