diff options
author | Craig A. Berry <craigberry@mac.com> | 2007-01-27 17:45:27 +0000 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2007-01-27 17:45:27 +0000 |
commit | 1cc0bb181613a49eb613dcbf3ac15b1ee178f165 (patch) | |
tree | 91a873beb40ae3cc30bdb157c450e5c3012fbe50 /lib/FindBin.pm | |
parent | 1e9c9d75c412e4fc5365565439a8f9413cb3d90a (diff) | |
download | perl-1cc0bb181613a49eb613dcbf3ac15b1ee178f165.tar.gz |
For FindBin to work as advertised on VMS, $FindBin::Bin
must be in unix syntax.
p4raw-id: //depot/perl@30037
Diffstat (limited to 'lib/FindBin.pm')
-rw-r--r-- | lib/FindBin.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/FindBin.pm b/lib/FindBin.pm index 0d75414a33..ed5d040e60 100644 --- a/lib/FindBin.pm +++ b/lib/FindBin.pm @@ -106,6 +106,13 @@ use File::Spec; $VERSION = "1.48"; + +# needed for VMS-specific filename translation +if( $^O eq 'VMS' ) { + require VMS::Filespec; + VMS::Filespec->import; +} + sub cwd2 { my $cwd = getcwd(); # getcwd might fail if it hasn't access to the current directory. @@ -124,6 +131,7 @@ sub init # perl invoked with -e or script is on C<STDIN> $Script = $RealScript = $0; $Bin = $RealBin = cwd2(); + $Bin = VMS::Filespec::unixify($Bin) if $^O eq 'VMS'; } else { @@ -131,7 +139,9 @@ sub init if ($^O eq 'VMS') { - ($Bin,$Script) = VMS::Filespec::rmsexpand($0) =~ /(.*\])(.*)/s; + ($Bin,$Script) = VMS::Filespec::rmsexpand($0) =~ /(.*[\]>]+)(.*)/s; + # C<use disk:[dev]/lib> isn't going to work, so unixify first + ($Bin = VMS::Filespec::unixify($Bin)) =~ s/\/\z//; ($RealBin,$RealScript) = ($Bin,$Script); } else |