Subject: | $ENV{PWD} is undef on Linux RedHat 6.2 => missing rootkey |
I've wrote someday about the fact that $PWD is not defined on Linux RedHat 6.2 (may be there are another systems with the same behaviour). I thought that the only place where this problem appears is t/assign.t but now I've detected another such place. The patch attached also fixes problems with illegal 'not' operation use.
--- /home/barancev/original/Apache-SharedMem-0.09/lib/Apache/SharedMem.pm Thu Oct 4 16:15:22 2001
+++ /usr/lib/perl5/site_perl/5.005/Apache/SharedMem.pm Sat Apr 6 18:13:12 2002
@@ -1162,16 +1162,17 @@
else
{
# we are in an undefined environment
- $docroot = $ENV{PWD};
+ use Cwd;
+ $docroot = cwd;
$uid = $<;
}
unless(defined $ipckey)
{
confess("PROJECT_DOCUMENT_ROOT doesn't exists or can't be accessed: " . (defined $docroot ? $docroot : '[undefined]'))
- if(not defined $docroot || $docroot eq '' || not -e $docroot || not -r $docroot);
+ unless(defined $docroot && $docroot ne '' && -e $docroot && -r $docroot);
confess("PROJECT_ID is not numeric: " . (defined $uid ? $uid : '[undefined]'))
- if(not defined $uid || $uid =~ /[^\d\-]/);
+ if(!defined $uid || $uid =~ /[^\d\-]/);
$ipckey = IPC::SysV::ftok($docroot, $uid);
}