how to find script directory

L

lucas

I run a perl app from different dirctories, and when i do a print `pwd`; it
shows the directory where I invoked the program. Problem is, I need to
read a file from the directory where the perl program is stored. Is there
a way to get the fully qualified location of the perl script? I've searched
through the system varibles, but found nothing.

thx
 
T

Tintin

lucas said:
I run a perl app from different dirctories, and when i do a print `pwd`; it
shows the directory where I invoked the program. Problem is, I need to
read a file from the directory where the perl program is stored. Is there
a way to get the fully qualified location of the perl script? I've searched
through the system varibles, but found nothing.

use Find::Bin;
 
J

Jay Tilton

:
: : > I run a perl app from different dirctories, and when i do a print `pwd`;
: it
: > shows the directory where I invoked the program. Problem is, I need to
: > read a file from the directory where the perl program is stored. Is there
: > a way to get the fully qualified location of the perl script? I've
: searched
: > through the system varibles, but found nothing.
:
: use Find::Bin;

Its name is "FindBin" .
 
L

lucas

Thanks for both your reply's. And I appologize for posting this twice. I
thought this one didn't go through.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,819
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top