Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How do I find what dir the perl script is running from?

by merlyn (Sage)
on Dec 16, 2000 at 13:53 UTC ( [id://47038]=note: print w/replies, xml ) Need Help??


in reply to How do I find what directory the perl script is running from?

No. There are partial answers based on examining $0 and $ENV{PATH}, with algorithms rolled up into File::FindBin, but nothing will ever be completely unspoofable or accurate.
  • Comment on Re: How do I find what dir the perl script is running from?

Replies are listed 'Best First'.
(tye)Re: Answer: How do I find what dir the perl script is running from?
by tye (Sage) on Dec 19, 2000 at 01:58 UTC

    See FindBin is broken (RE: How do I get the full path to the script executing?) for why this is completely wrong. (:

    Update: Just FYI, I interpret the original question as wanting to know about getcwd() and use Cwd, rather than wanting the full path to the script (which is what File::FindBin tries to find in a very perverse way). But it is hard to say for sure.

            - tye (but my friends call me "Tye")

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://47038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-26 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found