$path_unix = 1 if ($path =~ m#/#);
$path_unix = 1 if ($path =~ /^\.\.?$/);
my $path_vms = 0;
- $path_vms = 1 if ($path =~ m#[\[<\]]#);
+ $path_vms = 1 if ($path =~ m#(?<!\^)[\[<\]:]#);
$path_vms = 1 if ($path =~ /^--?$/);
my $dir_unix = 0;
$dir_unix = 1 if ($dir =~ m#/#);
$dir_unix = 1 if ($dir =~ /^\.\.?$/);
my $dir_vms = 0;
- $dir_vms = 1 if ($dir =~ m#[\[<\]]#);
+ $dir_vms = 1 if ($dir =~ m#(?<!\^)[\[<\]:]#);
$dir_vms = 1 if ($dir =~ /^--?$/);
my $unix_mode = 0;
$dir_unix = 1 if ($dir =~ m#/#);
$dir_unix = 1 if ($dir =~ /^\.\.?$/);
my $dir_vms = 0;
- $dir_vms = 1 if ($dir =~ m#[\[<\]]#);
+ $dir_vms = 1 if ($dir =~ m#(?<!\^)[\[<\]:]#);
$dir_vms = 1 if ($dir =~ /^--?$/);
if ($dir_vms == $dir_unix) {
# of the specification in order to merge them.
$file_unix = 1 if ($tfile =~ m#/#);
$file_unix = 1 if ($tfile =~ /^\.\.?$/);
- $file_vms = 1 if ($tfile =~ m#[\[<\]]#);
+ $file_vms = 1 if ($tfile =~ m#(?<!\^)[\[<\]:]#);
$file_vms = 1 if ($tfile =~ /^--?$/);
# We may know for sure what the format is.
my $tdir = $files[$i];
my $tdir_vms = 0;
my $tdir_unix = 0;
- $tdir_vms = 1 if ($tdir =~ m#[\[<\]]#);
+ $tdir_vms = 1 if ($tdir =~ m#(?<!\^)[\[<\]:]#);
$tdir_unix = 1 if ($tdir =~ m#/#);
$tdir_unix = 1 if ($tdir =~ /^\.\.?$/);
# if the spath ends with a directory delimiter and the file is bare,
# then just concat them.
- # FIX-ME: In VMS format "[]<>:" are not delimiters if preceded by '^'
- # Quite a bit of Perl does not know that yet.
- if ($spath =~ /^[^\)\]\/:>]+\)\Z(?!\n)/s && basename($file) eq $file) {
+ if ($spath =~ /^(?<!\^)[^\)\]\/:>]+\)\Z(?!\n)/s && basename($file) eq $file) {
$rslt = "$spath$file";
} else {
if ($efs) {
$spath_unix = 1 if ($spath =~ m#/#);
$spath_unix = 1 if ($spath =~ /^\.\.?$/);
my $spath_vms = 0;
- $spath_vms = 1 if ($spath =~ m#[\[<\]]#);
+ $spath_vms = 1 if ($spath =~ m#(?<!\^)[\[<\]:]#);
$spath_vms = 1 if ($spath =~ /^--?$/);
# Assume VMS mode
Returns a string representation of the first writable directory
from the following list or '' if none are writable:
- /tmp if C<DECC$FILENAME_REPORT_UNIX> is enabled.
+ /tmp if C<DECC$FILENAME_UNIX_REPORT> is enabled.
sys$scratch:
$ENV{TMPDIR}
my $vmsify_path = vmsify($path);
if ($efs) {
my $path_vms = 0;
- $path_vms = 1 if ($path =~ m#[\[<\]]#);
+ $path_vms = 1 if ($path =~ m#(?<!\^)[\[<\]:]#);
$path_vms = 1 if ($path =~ /^--?$/);
if (!$path_vms) {
return $self->SUPER::splitpath($path, $nofile);
# [--. ==> [-.-.
# .--] ==> .-.-]
# [--] ==> [-.-]
- $dirspec = "[$dirspec]" unless $dirspec =~ /[\[<]/; # make legal
+ $dirspec = "[$dirspec]" unless $dirspec =~ /(?<!\^)[\[<]/; # make legal
$dirspec =~ s/^(\[|<)\./$1/;
@dirs = split /(?<!\^)\./, vmspath($dirspec);
$dirs[0] =~ s/^[\[<]//s; $dirs[-1] =~ s/[\]>]\Z(?!\n)//s;
$dir_unix = 1 if ($dir =~ m#/#);
$dir_unix = 1 if ($dir =~ /^\.\.?$/);
my $dir_vms = 0;
- $dir_vms = 1 if ($dir =~ m#[\[<\]]#);
+ $dir_vms = 1 if ($dir =~ m#(?<!\^)[\[<\]:]#);
$dir_vms = 1 if ($dir =~ /^--?$/);
if ($efs && (length($dev) == 0)) {
$path_unix = 1 if ($path =~ m#/#);
$path_unix = 1 if ($path =~ /^\.\.?$/);
my $path_vms = 0;
- $path_vms = 1 if ($path =~ m#[\[<\]]#);
+ $path_vms = 1 if ($path =~ m#(?<!\^)[\[<\]:]#);
$path_vms = 1 if ($path =~ /^--?$/);
my $unix_mode = 0;
if (defined $base) {
$base_unix = 1 if ($base =~ m#/#);
$base_unix = 1 if ($base =~ /^\.\.?$/);
- $base_vms = 1 if ($base =~ m#[\[<\]]#);
+ $base_vms = 1 if ($base =~ m#(?<!\^)[\[<\]:]#);
$base_vms = 1 if ($base =~ /^--?$/);
if ($path_vms == $path_unix) {
$path_unix = 1 if ($path =~ m#/#);
$path_unix = 1 if ($path =~ /^\.\.?$/);
my $path_vms = 0;
- $path_vms = 1 if ($path =~ m#[\[<\]]#);
+ $path_vms = 1 if ($path =~ m#(?<!\^)[\[<\]:]#);
$path_vms = 1 if ($path =~ /^--?$/);
my $unix_mode = 0;
if (defined $base) {
$base_unix = 1 if ($base =~ m#/#);
$base_unix = 1 if ($base =~ /^\.\.?$/);
- $base_vms = 1 if ($base =~ m#[\[<\]]#);
+ $base_vms = 1 if ($base =~ m#(?<!\^)[\[<\]:]#);
$base_vms = 1 if ($base =~ /^--?$/);
# If we could not determine the path mode, see if we can find out
if ($efs) {
# base may have changed, so need to look up format again.
if ($unix_mode) {
- $base_vms = 1 if ($base =~ m#[\[<\]]#);
+ $base_vms = 1 if ($base =~ m#(?<!\^)[\[<\]:]#);
$base_vms = 1 if ($base =~ /^--?$/);
$base = unixpath($base) if $base_vms;
$base .= '/' unless ($base =~ m#/$#);