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: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Friday, September 26, 2003 7:58 PM > To: Cameron B. Prince > Cc: [EMAIL PROTECTED] > 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: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]