BEGIN {use_ok('File::Glob', ':glob')};
use Cwd ();
+my $vms_unix_rpt = 0;
+my $vms_efs = 0;
+my $vms_mode = 0;
+if ($^O eq 'VMS') {
+ if (eval 'require VMS::Feature') {
+ $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
+ $vms_efs = VMS::Feature::current("efs_charset");
+ } else {
+ my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
+ my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
+ $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
+ $vms_efs = $efs_charset =~ /^[ET1]/i;
+ }
+ $vms_mode = 1 unless ($vms_unix_rpt);
+}
+
+
# look for the contents of the current directory
$ENV{PATH} = "/bin";
delete @ENV{qw(BASH_ENV CDPATH ENV IFS)};
print "# @a\n";
-is_deeply(\@a, [($^O eq 'VMS'? 'test.' : 'TEST'), 'a', 'b']);
+is_deeply(\@a, [($vms_mode ? 'test.' : 'TEST'), 'a', 'b']);
# "~" should expand to $ENV{HOME}
$ENV{HOME} = "sweet home";
$Is_UWin = $^O eq 'uwin';
$Is_OS390 = $^O eq 'os390';
+my $vms_unix_rpt = 0;
+my $vms_efs = 0;
+my $unix_mode = 1;
+
+if ($Is_VMS) {
+ $unix_mode = 0;
+ if (eval 'require VMS::Feature') {
+ $vms_unix_rpt = VMS::Feature::current("filename_unix_report");
+ $vms_efs = VMS::Feature::current("efs_charset");
+ } else {
+ my $unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || '';
+ my $efs_charset = $ENV{'DECC$EFS_CHARSET'} || '';
+ $vms_unix_rpt = $unix_rpt =~ /^[ET1]/i;
+ $vms_efs = $efs_charset =~ /^[ET1]/i;
+ }
+
+ # Traditional VMS mode only if VMS is not in UNIX compatible mode.
+ $unix_mode = ($vms_efs && $vms_unix_rpt);
+
+}
+
+
ok( $testfd = open("TEST", O_RDONLY, 0), 'O_RDONLY with open' );
read($testfd, $buffer, 4) if $testfd > 2;
is( $buffer, "#!./", ' with read' );
if ($Is_MacOS) {
$pat = qr/:t:$/;
}
-elsif ( $Is_VMS ) {
- $pat = qr/\.T]/i;
+elsif ( $unix_mode ) {
+ $pat = qr#[\\/]t$#i;
}
else {
- $pat = qr#[\\/]t$#i;
+ $pat = qr/\.T]/i;
}
like( getcwd(), qr/$pat/, 'getcwd' );