On Wed, 4 Sep 2002 [EMAIL PROTECTED] wrote:

>
> On 04/09/2002 11:51:33 Tillman, James wrote:
>
> >>
> >> [EMAIL PROTECTED] wrote:
> >> >
> >> >
> >> > Hi!
> >> >
> >> > There is some way to get the current directory path of perl script?
>                                   ^^^^^^^^^^^^^^^^^
> >>
> >> Try core Cwd module.
> >
> >That actually returns the current directory, which may or may not be the
> >directory of the script when it is run.  FindBin may be a better choice in
> >this case.  Also a core module, and mentioned in the docs.
> >
>
> The original question was ambiguous. The word "current" suggests something
> that changes. The path of the script doesn't change during runtime, hence
> I would have thought that the initial poster wanted Cwd.
>
> It seems that between you and $Bill all possibilities have been covered.
> And I learnt about FindBin. I would have thought of $0 for that case.


AFAIK, on Windows's OSes the $0 variable is just the basename not the
full patch name. If the script was running as a cgi app, the
$ENV{PATH_TRANSLATED) _may_ provide the scripts full path name from
which the script's directory can be determined with a regex.

**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to