Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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? 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?
(tye)Re: Answer: How do I find what dir the perl script is running from?
by tye (Cardinal) 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 exploiting the Monastery: (6)
As of 2014-07-12 12:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (239 votes), past polls