for (;;) {
my $direntry;
($odev, $oino) = ($cdev, $cino);
- chdir('..') || return undef;
+ CORE::chdir('..') || return undef;
($cdev, $cino) = stat('.');
last if $odev == $cdev && $oino == $cino;
opendir(DIR, '.') || return undef;
# At this point $path may be tainted (if tainting) and chdir would fail.
# To be more useful we untaint it then check that we landed where we started.
$path = $1 if $path =~ /^(.*)$/; # untaint
- chdir($path) || return undef;
+ CORE::chdir($path) || return undef;
($cdev, $cino) = stat('.');
die "Unstable directory path, current directory changed unexpectedly"
if $cdev != $orig_cdev || $cino != $orig_cino;
sub fast_abs_path {
my $cwd = getcwd();
my $path = shift || '.';
- chdir($path) || croak "Cannot chdir to $path:$!";
+ CORE::chdir($path) || croak "Cannot chdir to $path:$!";
my $realpath = getcwd();
- chdir($cwd) || croak "Cannot chdir back to $cwd:$!";
+ CORE::chdir($cwd) || croak "Cannot chdir back to $cwd:$!";
$realpath;
}