summaryrefslogtreecommitdiff
path: root/cpan/lib/File/Spec/Functions.pm
diff options
context:
space:
mode:
Diffstat (limited to 'cpan/lib/File/Spec/Functions.pm')
-rw-r--r--cpan/lib/File/Spec/Functions.pm35
1 files changed, 33 insertions, 2 deletions
diff --git a/cpan/lib/File/Spec/Functions.pm b/cpan/lib/File/Spec/Functions.pm
index 1c36e8b9..470c7718 100644
--- a/cpan/lib/File/Spec/Functions.pm
+++ b/cpan/lib/File/Spec/Functions.pm
@@ -5,7 +5,8 @@ use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $VERSION);
-$VERSION = '1.3';
+$VERSION = '3.62';
+$VERSION =~ tr/_//d;
require Exporter;
@@ -36,10 +37,30 @@ require Exporter;
%EXPORT_TAGS = ( ALL => [ @EXPORT_OK, @EXPORT ] );
+require File::Spec::Unix;
+my %udeps = (
+ canonpath => [],
+ catdir => [qw(canonpath)],
+ catfile => [qw(canonpath catdir)],
+ case_tolerant => [],
+ curdir => [],
+ devnull => [],
+ rootdir => [],
+ updir => [],
+);
+
foreach my $meth (@EXPORT, @EXPORT_OK) {
my $sub = File::Spec->can($meth);
no strict 'refs';
- *{$meth} = sub {&$sub('File::Spec', @_)};
+ if (exists($udeps{$meth}) && $sub == File::Spec::Unix->can($meth) &&
+ !(grep {
+ File::Spec->can($_) != File::Spec::Unix->can($_)
+ } @{$udeps{$meth}}) &&
+ defined(&{"File::Spec::Unix::_fn_$meth"})) {
+ *{$meth} = \&{"File::Spec::Unix::_fn_$meth"};
+ } else {
+ *{$meth} = sub {&$sub('File::Spec', @_)};
+ }
}
@@ -93,7 +114,17 @@ The following functions are exported only by request.
All the functions may be imported using the C<:ALL> tag.
+=head1 COPYRIGHT
+
+Copyright (c) 2004 by the Perl 5 Porters. All rights reserved.
+
+This program is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
=head1 SEE ALSO
File::Spec, File::Spec::Unix, File::Spec::Mac, File::Spec::OS2,
File::Spec::Win32, File::Spec::VMS, ExtUtils::MakeMaker
+
+=cut
+