in reply to Using FindBin or CWD from within a CGI program

Looks like your Apache is configured not to give your script access to anything outside your own directory. So "/" is the root of your own directory, not the root of the system itself.

What does
use CGI; use Cwd; mkdir "test"; chdir "test"; my $currentdir = getcwd; print "Current dir is: $currentdir \n";
print?


holli, /regexed monk/

Replies are listed 'Best First'.
Re^2: Getting CWD from within a CGI program
by smack (Beadle) on Nov 21, 2005 at 17:29 UTC
    The output is still: "Current dir is: /". I am running the script frm my DocumentRoot either. I tried using FindBin as well, the following has the same result:
    use FindBin; print "\nBinary is: $FindBin::Bin \n";
    It works fine when run from the command line.

    “There are no cats in America, and the streets are paved with cheese.” -Fievel Mousekewitz