Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

can the script find itself?

0 views
Skip to first unread message

fossildoc

unread,
Apr 6, 2008, 11:53:35 AM4/6/08
to
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.

Frank Seitz

unread,
Apr 6, 2008, 11:55:49 AM4/6/08
to

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

fossildoc

unread,
Apr 6, 2008, 12:24:04 PM4/6/08
to
On Apr 6, 11:55 am, Frank Seitz <devnull4...@web.de> wrote:
>
> perldoc FindBin
>
> Frank
> --

Thanks, Frank. It works fine.

Petr Vileta

unread,
Apr 7, 2008, 10:27:50 PM4/7/08
to

$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>

0 new messages