The FindBin module determines the current working directory at compile time using this function (see source code here):
sub cwd2 {
my $cwd = getcwd();
# getcwd might fail if it hasn't access to the current directory.
# try harder.
defined $cwd or $cwd = cwd();
$cwd;
}
where cwd() and getcwd() are both imported from the Cwd module. In which cases would getcwd() fail but cwd() still work? ( I am most interested in the Linux platform if that matters )
See also: