Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

( #47038=categorized answer: print w/ replies, xml ) Need Help??

Q&A > GUI Programming > How do I find what directory the perl script is running from? - Answer contributed by merlyn

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 Answer: 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
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2016-07-24 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (221 votes). Check out past polls.