$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.
# 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 ) ;
return $self->canonpath( $path ) ;
}
-
=back
=head1 SEE ALSO
=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;