absolute path of current process



Is this:

my $path = [File::Spec->splitpath (File::Spec->rel2abs ($0))]->[1];

the only OS independent (unix/win32) way to determine the absolute path of
the directory which contains the current process, or there is a less cryptic
way that I am overlooking?

P.S. I know the above will not work if somebody tinkers with $0, but this is
not relevant to my situation.

Thanks

Peter
.



Relevant Pages

  • Re: absolute path of current process
    ... >> the only OS independent (unix/win32) way to determine the absolute path of ... Paul Johnson - paul@xxxxxxxx ... Prev by Date: ...
    (perl.beginners)
  • Re: absolute path of current process
    ... > the only OS independent (unix/win32) way to determine the absolute path of ... to work on win32 it becomes even more cryptic: ... Prev by Date: ...
    (perl.beginners)
  • Re: absolute path of current process
    ... > the only OS independent (unix/win32) way to determine the absolute path of ... use Cwd qw; ... Prev by Date: ...
    (perl.beginners)
  • Re: absolute path of current process
    ... >> the only OS independent (unix/win32) way to determine the absolute path of ... > use Cwd qw; ... absolute path, with relative path, from cron, etc.). ...
    (perl.beginners)
  • String code required please
    ... Does someone have the Python code to pull just the filename and ... extension from the end of an absolute path please. ... Prev by Date: ...
    (comp.lang.python)