package File::Spec::Unix;
use strict;
-use vars qw($VERSION);
-
-$VERSION = '3.58';
-my $xs_version = $VERSION;
-$VERSION =~ tr/_//;
-
-#dont try to load XSLoader and DynaLoader only to ultimately fail on miniperl
-if(!defined &canonpath && defined &DynaLoader::boot_DynaLoader) {
- eval {#eval is questionable since we are handling potential errors like
- #"Cwd object version 3.48 does not match bootstrap parameter 3.50
- #at lib/DynaLoader.pm line 216." by having this eval
- if ( $] >= 5.006 ) {
- require XSLoader;
- XSLoader::load("Cwd", $xs_version);
- } else {
- require Cwd;
- }
- };
-}
+use Cwd ();
+
+our $VERSION = '3.69';
+$VERSION =~ tr/_//d;
=head1 NAME
@dirlist = grep { ! Scalar::Util::tainted($_) } @dirlist;
}
elsif ($] < 5.007) { # No ${^TAINT} before 5.8
- @dirlist = grep { eval { eval('1'.substr $_,0,0) } } @dirlist;
+ @dirlist = grep { !defined($_) || eval { eval('1'.substr $_,0,0) } }
+ @dirlist;
}
foreach (@dirlist) {
sub abs2rel {
my($self,$path,$base) = @_;
- $base = $self->_cwd() unless defined $base and length $base;
+ $base = Cwd::getcwd() unless defined $base and length $base;
($path, $base) = map $self->canonpath($_), $path, $base;
}
}
else {
- my $wd= ($self->splitpath($self->_cwd(), 1))[1];
+ my $wd= ($self->splitpath(Cwd::getcwd(), 1))[1];
$path_directories = $self->catdir($wd, $path);
$base_directories = $self->catdir($wd, $base);
}
if ( ! $self->file_name_is_absolute( $path ) ) {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- $base = $self->_cwd();
+ $base = Cwd::getcwd();
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
$base = $self->rel2abs( $base ) ;
=cut
-# Internal routine to File::Spec, no point in making this public since
-# it is the standard Cwd interface. Most of the platform-specific
-# File::Spec subclasses use this.
-sub _cwd {
- require Cwd;
- Cwd::getcwd();
-}
-
-
# Internal method to reduce xx\..\yy -> yy
sub _collapse {
my($fs, $path) = @_;