How can I get the full path for the running script (like $0)

S

sm

Hi Folks,
I need to know the full path to the running script ( $0 provides the name of
the file)
is there a way to get the full path.
for example:
I run the script "/root/eng/perlscripts/xyz.pl"
$0 = xyz.pl
I need a way to know "/root/eng/perlscripts/xyz.pl"

Thanks
-sm
 
I

it_says_BALLS_on_your_forehead

sm said:
Hi Folks,
I need to know the full path to the running script ( $0 provides the name of
the file)
is there a way to get the full path.
for example:
I run the script "/root/eng/perlscripts/xyz.pl"
$0 = xyz.pl
I need a way to know "/root/eng/perlscripts/xyz.pl"

try running the script by specifying the full path when you call it.
 
T

Tad McClellan

sm said:
I need to know the full path to the running script


perldoc -q path

How do I add the directory my program lives in to the module/library
search path?
 

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
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top