summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTels <nospam-abuse@bloodgate.com>2003-07-08 00:41:42 +0200
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-17 07:50:00 +0000
commit72f15715c6c3759affc3e9b41e7833c9c3ccb901 (patch)
tree22a01456f51c0d8826fa0029b94660dc8e6d381c
parent4a094b8061e567109cdf00844f8e2bd6041f76f3 (diff)
downloadperl-72f15715c6c3759affc3e9b41e7833c9c3ccb901.tar.gz
The "reduce memory footprint and increase speed by not
unconditionally pulling in Cwd" part of Subject: [PATCH] File::Spec on diet Message-Id: <200307072235.03364@bloodgate.com> was still valid. p4raw-id: //depot/perl@20744
-rw-r--r--lib/File/Spec/Cygwin.pm5
-rw-r--r--lib/File/Spec/Epoc.pm6
-rw-r--r--lib/File/Spec/Mac.pm9
-rw-r--r--lib/File/Spec/OS2.pm7
-rw-r--r--lib/File/Spec/Unix.pm8
-rw-r--r--lib/File/Spec/VMS.pm10
-rw-r--r--lib/File/Spec/Win32.pm4
7 files changed, 26 insertions, 23 deletions
diff --git a/lib/File/Spec/Cygwin.pm b/lib/File/Spec/Cygwin.pm
index 6f3577f1e8..541bad0d18 100644
--- a/lib/File/Spec/Cygwin.pm
+++ b/lib/File/Spec/Cygwin.pm
@@ -18,9 +18,8 @@ File::Spec::Cygwin - methods for Cygwin file specs
=head1 DESCRIPTION
-See File::Spec::Unix for a documentation of the methods provided
-there. This package overrides the implementation of these methods, not
-the semantics.
+See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
+implementation of these methods, not the semantics.
This module is still in beta. Cygwin-knowledgeable folks are invited
to offer patches and suggestions.
diff --git a/lib/File/Spec/Epoc.pm b/lib/File/Spec/Epoc.pm
index 91c3a1d7e8..89ca0b99d9 100644
--- a/lib/File/Spec/Epoc.pm
+++ b/lib/File/Spec/Epoc.pm
@@ -1,7 +1,6 @@
package File::Spec::Epoc;
use strict;
-use Cwd;
use vars qw($VERSION @ISA);
$VERSION = '1.1';
@@ -59,9 +58,12 @@ sub canonpath {
return $path;
}
+=pod
+
=head1 SEE ALSO
-L<File::Spec>
+See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
+implementation of these methods, not the semantics.
=cut
diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm
index 513e837f14..83bd7094b5 100644
--- a/lib/File/Spec/Mac.pm
+++ b/lib/File/Spec/Mac.pm
@@ -8,7 +8,6 @@ $VERSION = '1.4';
@ISA = qw(File::Spec::Unix);
-use Cwd;
my $macfiles;
if ($^O eq 'MacOS') {
$macfiles = eval { require Mac::Files };
@@ -657,7 +656,7 @@ sub abs2rel {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- $base = cwd();
+ $base = $self->cwd();
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
$base = $self->rel2abs( $base ) ;
@@ -725,7 +724,7 @@ sub rel2abs {
if ( ! $self->file_name_is_absolute($path) ) {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- $base = cwd();
+ $base = $self->cwd();
}
elsif ( ! $self->file_name_is_absolute($base) ) {
$base = $self->rel2abs($base) ;
@@ -757,10 +756,10 @@ sub rel2abs {
See the authors list in I<File::Spec>. Mac OS support by Paul Schinder
<schinder@pobox.com> and Thomas Wegner <wegner_thomas@yahoo.com>.
-
=head1 SEE ALSO
-L<File::Spec>
+See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
+implementation of these methods, not the semantics.
=cut
diff --git a/lib/File/Spec/OS2.pm b/lib/File/Spec/OS2.pm
index 9bd9381a67..f323358fd6 100644
--- a/lib/File/Spec/OS2.pm
+++ b/lib/File/Spec/OS2.pm
@@ -200,6 +200,7 @@ sub abs2rel {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
+ require Cwd;
$base = Cwd::sys_cwd() ;
} elsif ( ! $self->file_name_is_absolute( $base ) ) {
$base = $self->rel2abs( $base ) ;
@@ -258,6 +259,7 @@ sub rel2abs {
if ( ! $self->file_name_is_absolute( $path ) ) {
if ( !defined( $base ) || $base eq '' ) {
+ require Cwd;
$base = Cwd::sys_cwd() ;
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
@@ -296,6 +298,5 @@ File::Spec::OS2 - methods for OS/2 file specs
=head1 DESCRIPTION
-See File::Spec::Unix for a documentation of the methods provided
-there. This package overrides the implementation of these methods, not
-the semantics.
+See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
+implementation of these methods, not the semantics.
diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm
index 9de1cf7f39..e27672904d 100644
--- a/lib/File/Spec/Unix.pm
+++ b/lib/File/Spec/Unix.pm
@@ -5,8 +5,6 @@ use vars qw($VERSION);
$VERSION = '1.5';
-use Cwd;
-
=head1 NAME
File::Spec::Unix - File::Spec for Unix, base for other File::Spec modules
@@ -375,7 +373,8 @@ sub abs2rel {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- $base = cwd() ;
+ require Cwd;
+ $base = Cwd::cwd() ;
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
$base = $self->rel2abs( $base ) ;
@@ -447,7 +446,8 @@ sub rel2abs {
if ( ! $self->file_name_is_absolute( $path ) ) {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- $base = cwd() ;
+ require Cwd;
+ $base = Cwd::cwd() ;
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
$base = $self->rel2abs( $base ) ;
diff --git a/lib/File/Spec/VMS.pm b/lib/File/Spec/VMS.pm
index 70eb39b40f..9d909b179b 100644
--- a/lib/File/Spec/VMS.pm
+++ b/lib/File/Spec/VMS.pm
@@ -8,7 +8,6 @@ $VERSION = '1.4';
@ISA = qw(File::Spec::Unix);
-use Cwd;
use File::Basename;
use VMS::Filespec;
@@ -404,7 +403,8 @@ sub abs2rel {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- $base = cwd() ;
+ require Cwd;
+ $base = Cwd::cwd() ;
$base = $self->canonpath( $base ) ;
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
@@ -464,7 +464,8 @@ sub rel2abs {
if ( ! $self->file_name_is_absolute( $path ) ) {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- $base = cwd() ;
+ require Cwd;
+ $base = Cwd::cwd() ;
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
$base = $self->rel2abs( $base ) ;
@@ -501,7 +502,8 @@ sub rel2abs {
=head1 SEE ALSO
-L<File::Spec>
+See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
+implementation of these methods, not the semantics.
=cut
diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm
index 26d92bacc4..d97708ad22 100644
--- a/lib/File/Spec/Win32.pm
+++ b/lib/File/Spec/Win32.pm
@@ -1,7 +1,6 @@
package File::Spec::Win32;
use strict;
-use Cwd;
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
@@ -360,7 +359,8 @@ Novell NetWare inherits its File::Spec behaviour from File::Spec::Win32.
=head1 SEE ALSO
-L<File::Spec>
+See L<File::Spec> and L<File::Spec::Unix>. This package overrides the
+implementation of these methods, not the semantics.
=cut