Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   How can I get the full path for the running script (like $0) (http://www.velocityreviews.com/forums/t896284-how-can-i-get-the-full-path-for-the-running-script-like-0-a.html)

sm 01-26-2006 01:18 AM

How can I get the full path for the running script (like $0)
 
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



usenet@DavidFilmer.com 01-26-2006 01:38 AM

Re: How can I get the full path for the running script (like $0)
 
sm wrote:
> I need to know the full path to the running script


perldoc FindBin

--
http://DavidFilmer.com


it_says_BALLS_on_your_forehead 01-26-2006 03:35 AM

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

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.


Tad McClellan 01-26-2006 12:51 PM

Re: How can I get the full path for the running script (like $0)
 
sm <imfeaw5672@pacbell.net> 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
tadmc@augustmail.com Perl programming
Fort Worth, Texas


All times are GMT. The time now is 08:13 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.