diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-01-17 09:28:34 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-01-17 09:28:34 +0000 |
commit | 63abd72361fb73532e62d9d6ca4c48236f714f59 (patch) | |
tree | edf8d566cf71741b7b66c6afa587faddf9181099 /lib/FindBin.pm | |
parent | 4a2cb1e7e2802123990e5b11af5e64b2dc6f0455 (diff) | |
download | perl-63abd72361fb73532e62d9d6ca4c48236f714f59.tar.gz |
undo change#2571; C<use File::Spec> instead
p4raw-link: @2571 on //depot/cfgperl: d5e6d479963de089122e954c00ec89b003ac06e4
p4raw-id: //depot/perl@2624
Diffstat (limited to 'lib/FindBin.pm')
-rw-r--r-- | lib/FindBin.pm | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/lib/FindBin.pm b/lib/FindBin.pm index cd1871f54b..b9aeb3640a 100644 --- a/lib/FindBin.pm +++ b/lib/FindBin.pm @@ -74,6 +74,7 @@ package FindBin; use Carp; require 5.000; require Exporter; +use File::Spec qw(file_name_is_absolute); use Cwd qw(getcwd abs_path); use Config; use File::Basename; @@ -82,26 +83,7 @@ use File::Basename; %EXPORT_TAGS = (ALL => [qw($Bin $Script $RealBin $RealScript $Dir $RealDir)]); @ISA = qw(Exporter); -$VERSION = $VERSION = sprintf("%d.%02d", q$Revision: 1.41 $ =~ /(\d+)\.(\d+)/); - -sub is_abs_path -{ - local $_ = shift if (@_); - if ($^O eq 'MSWin32' || $^O eq 'dos') - { - return m#^([a-z]:[\\/]|\\\\)#i; - } - elsif ($^O eq 'VMS') - { - # If it's a logical name, expand it. - $_ = $ENV{$_} while /^[\w\$\-]+$/ and $ENV{$_}; - return m!^/! or m![<\[][^.\-\]>]! or /:[^<\[]/; - } - else - { - return m#^/#; - } -} +$VERSION = $VERSION = sprintf("%d.%02d", q$Revision: 1.42 $ =~ /(\d+)\.(\d+)/); BEGIN { @@ -160,7 +142,7 @@ BEGIN # Ensure $script contains the complete path incase we C<chdir> - $script = getcwd() . "/" . $script unless is_abs_path($script); + $script = getcwd() . "/" . $script unless file_name_is_absolute($script); ($Script,$Bin) = fileparse($script); @@ -172,7 +154,7 @@ BEGIN ($RealScript,$RealBin) = fileparse($script); last unless defined $linktext; - $script = (is_abs_path($linktext)) + $script = (file_name_is_absolute($linktext)) ? $linktext : $RealBin . "/" . $linktext; } |