You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Marek Matis <ma...@gmail.com> on 2006/08/08 00:14:06 UTC

Problem with relative path

Hi,
I have EmbPerl2.0r3, Apache2, mod_perl2 1.99 (Debian Sarge)

/foo/index.epl:
[-
  open F, "/foo/example_file.txt";   # <-- THIS WORKING
  open F, "./example_file.txt";  # <-- THIS NOT WORKING, WHY ?
-]

Thanks
Marek

RE: Problem with relative path

Posted by Gerald Richter <ri...@ecos.de>.
Hi,
> I have EmbPerl2.0r3, Apache2, mod_perl2 1.99 (Debian Sarge) 
> 
> /foo/index.epl:
> [-
>   open F, "/foo/example_file.txt";   # <-- THIS WORKING
>   open F, "./example_file.txt";  # <-- THIS NOT WORKING, WHY ? 
> -]
> 

For performance reasons, Embperl 2 does not change the current directory.

You can get the directory of your script with $epreq -> component -> cwd, so
you can write

  open F, $epreq -> component -> cwd . "/example_file.txt"; 

Gerald


 
** Virus checked by BB-5000 Mailfilter ** 


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