summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-18 07:01:16 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-18 07:01:16 +0000
commitc063e98f8c69b3768b03c1dc05dae8a9c315cd4b (patch)
tree850b26d5ff534791a36e4b6790719579cf3fc309 /lib/File
parent786c9463ced2257d99e73491484131a7cb28867b (diff)
downloadperl-c063e98f8c69b3768b03c1dc05dae8a9c315cd4b.tar.gz
I could have sworn the base class method was there.
p4raw-id: //depot/perl@20752
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Spec/Unix.pm19
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm
index e27672904d..c76152b0bd 100644
--- a/lib/File/Spec/Unix.pm
+++ b/lib/File/Spec/Unix.pm
@@ -338,9 +338,10 @@ from the base path to the destination path:
$rel_path = File::Spec->abs2rel( $path ) ;
$rel_path = File::Spec->abs2rel( $path, $base ) ;
-If $base is not present or '', then L<cwd()|Cwd> is used. If $base is relative,
-then it is converted to absolute form using L</rel2abs()>. This means that it
-is taken to be relative to L<cwd()|Cwd>.
+If $base is not present or '', then L<cwd()|Cwd> is used. If $base is
+relative, then it is converted to absolute form using
+L</rel2abs()>. This means that it is taken to be relative to
+L<cwd()|Cwd>.
On systems with the concept of a volume, this assumes that both paths
are on the $destination volume, and ignores the $base volume.
@@ -373,8 +374,7 @@ sub abs2rel {
# Figure out the effective $base and clean it up.
if ( !defined( $base ) || $base eq '' ) {
- require Cwd;
- $base = Cwd::cwd() ;
+ $base = $self->cwd();
}
elsif ( ! $self->file_name_is_absolute( $base ) ) {
$base = $self->rel2abs( $base ) ;
@@ -463,7 +463,6 @@ sub rel2abs {
return $self->canonpath( $path ) ;
}
-
=back
=head1 SEE ALSO
@@ -472,4 +471,12 @@ L<File::Spec>
=cut
+# Internal routine to File::Spec, no point in publicly documenting
+# this interface since it's the standard Cwd interface. Some of the
+# platform-specific File::Spec subclasses use this.
+sub cwd {
+ require Cwd;
+ Cwd::cwd();
+}
+
1;