diff options
| author | fukachan <fukachan> | 2018-01-13 08:48:42 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2018-01-13 08:48:42 +0000 |
| commit | 28a388f6aeced7f8dd585a84bde0f0ddf0bb7a69 (patch) | |
| tree | 7fbe3b9fc9209113e15e00fbdf9663ff1f16190d /cpan/lib/File/Spec/OS2.pm | |
| parent | dbab3c94592a2f0ef40175cf39cf89fbe5503c41 (diff) | |
| download | fml8-PathTools-3-62.tar.gz fml8-PathTools-3-62.tar.bz2 fml8-PathTools-3-62.zip | |
import PathTools-3.62PathTools-3-62
Diffstat (limited to 'cpan/lib/File/Spec/OS2.pm')
| -rw-r--r-- | cpan/lib/File/Spec/OS2.pm | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/cpan/lib/File/Spec/OS2.pm b/cpan/lib/File/Spec/OS2.pm index 47dc0a6a..55e6d335 100644 --- a/cpan/lib/File/Spec/OS2.pm +++ b/cpan/lib/File/Spec/OS2.pm @@ -4,7 +4,8 @@ use strict; use vars qw(@ISA $VERSION); require File::Spec::Unix; -$VERSION = '1.2'; +$VERSION = '3.62'; +$VERSION =~ tr/_//d; @ISA = qw(File::Spec::Unix); @@ -34,13 +35,13 @@ sub _cwd { return Cwd::sys_cwd(); } -my $tmpdir; sub tmpdir { - return $tmpdir if defined $tmpdir; - my $self = shift; - $tmpdir = $self->_tmpdir( @ENV{qw(TMPDIR TEMP TMP)}, - '/tmp', - '/' ); + my $cached = $_[0]->_cached_tmpdir(qw 'TMPDIR TEMP TMP'); + return $cached if defined $cached; + my @d = @ENV{qw(TMPDIR TEMP TMP)}; # function call could autovivivy + $_[0]->_cache_tmpdir( + $_[0]->_tmpdir( @d, '/tmp', '/' ), qw 'TMPDIR TEMP TMP' + ); } sub catdir { @@ -56,6 +57,8 @@ sub catdir { sub canonpath { my ($self,$path) = @_; + return unless defined $path; + $path =~ s/^([a-z]:)/\l$1/s; $path =~ s|\\|/|g; $path =~ s|([^/])/+|$1/|g; # xx////xx -> xx/xx @@ -263,4 +266,11 @@ Volumes can be drive letters or UNC sharenames (\\server\share). =back +=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. + =cut |
