Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How can I get the full path for the running script (like $0)

Reply
Thread Tools

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

 
 
sm
Guest
Posts: n/a
 
      01-26-2006
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


 
Reply With Quote
 
 
 
 
usenet@DavidFilmer.com
Guest
Posts: n/a
 
      01-26-2006
sm wrote:
> I need to know the full path to the running script


perldoc FindBin

--
http://DavidFilmer.com

 
Reply With Quote
 
 
 
 
it_says_BALLS_on_your_forehead
Guest
Posts: n/a
 
      01-26-2006

sm wrote:
> 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.

 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      01-26-2006
sm <> wrote:

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


--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
os.path.walk() to get full path of all files dude Python 5 03-17-2011 09:09 AM
How can I retrieve the full path of running exe somank.sharma@gmail.com C Programming 4 06-21-2007 09:07 AM
sys.argv[0] doesn't always contain the full path of running script. gmax2006 Python 7 08-31-2006 09:12 PM
Simple way to get the full path of a running script? Benjamin Han Python 7 01-03-2004 07:15 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57