【发布时间】:2016-06-11 15:21:19
【问题描述】:
FindBin 模块在编译时使用该函数确定当前工作目录(参见源代码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;
}
其中cwd() 和getcwd() 都是从Cwd 模块导入的。在哪些情况下getcwd() 会失败但cwd() 仍然有效? (如果重要的话,我对 Linux 平台最感兴趣)
另见:
【问题讨论】:
标签: perl