From: fossildoc on
I'm running build 813 on 'doze XP/Home. I want my Perl script to
determine the directory from which it was run. This is equivalent to
retrieving the command line. For example, from a DOS window I type:
>\perl\bin\perl c:\mydir\myscript.pl
I want the script to be able to retrieve the string "c:\mydir".

There is a Win32 function, Find, that can look for files, but it only
searches the INC directories, so it is not reliable.

Any ideas, please.
From: Frank Seitz on
fossildoc wrote:
> I'm running build 813 on 'doze XP/Home. I want my Perl script to
> determine the directory from which it was run. This is equivalent to
> retrieving the command line. For example, from a DOS window I type:
>
>>\perl\bin\perl c:\mydir\myscript.pl
>
> I want the script to be able to retrieve the string "c:\mydir".
>
> There is a Win32 function, Find, that can look for files, but it only
> searches the INC directories, so it is not reliable.
>
> Any ideas, please.

perldoc FindBin

Frank
--
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen f�r Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel
From: fossildoc on
On Apr 6, 11:55 am, Frank Seitz <devnull4...(a)web.de> wrote:
>
> perldoc FindBin
>
> Frank
> --

Thanks, Frank. It works fine.

From: Petr Vileta on
fossildoc wrote:
> I'm running build 813 on 'doze XP/Home. I want my Perl script to
> determine the directory from which it was run. This is equivalent to
> retrieving the command line. For example, from a DOS window I type:
>> \perl\bin\perl c:\mydir\myscript.pl
> I want the script to be able to retrieve the string "c:\mydir".
>
> There is a Win32 function, Find, that can look for files, but it only
> searches the INC directories, so it is not reliable.
>
> Any ideas, please.

$0 can't to help you?


--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your
mail from another non-spammer site please.)

Please reply to <petr AT practisoft DOT cz>