Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

( #47267=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 cei

I picked up this cross-platform directory checker somewhere... Works on both NT and *NIX
if ($0=~m#^(.*)\\#) { $cgi_dir = "$1"; } elsif ($0=~m#^(.*)/# ) { $ cgi_dir = "$1"; } else {`pwd` =~ /(.*)/; $ cgi_dir = "$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 lurking in the Monastery: (4)
As of 2015-02-01 11:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (263 votes), past polls