Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

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

( #239020=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 Vennis

This works quite well:
$0=~/^(.+[\\\/])[^\\\/]+[\\\/]*$/; $cgidir= $1 || "./";

Comment on Answer: How do I find what dir the perl script is running from?
Download Code
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 musing on the Monastery: (15)
As of 2014-12-18 08:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (47 votes), past polls