This draft documentation is taylored for a perl to specifically go with
the RMS Symbolic link test SDK, so may need some changes for other purposes.
The specific information on about the Posix Compliant mode may change
with the eventual VMS release that implements it.
The Perl for the RMS Symbolic Link test kit has not yet finished QTV
testing.
And this has probably given everyone enough reading for the moment, so
it is my last direct sending today.
-John
[EMAIL PROTECTED]
Personal Opinion Only
--- vms/perlvms.pod_5_8_6 Thu Jun 30 15:36:37 2005
+++ vms/perlvms.pod Fri Jul 1 15:51:08 2005
@@ -6,7 +6,7 @@
Gathered below are notes describing details of Perl 5's
behavior on VMS. They are a supplement to the regular Perl 5
-documentation, so we have focussed on the ways in which Perl
+documentation, so we have focused on the ways in which Perl
5 functions differently under VMS than it does under Unix,
and on the interactions between Perl and the rest of the
operating system. We haven't tried to duplicate complete
@@ -121,11 +121,11 @@
I<N.B.> The procedure by which extensions are built and
tested creates several levels (at least 4) under the
directory in which the extension's source files live.
-For this reason if you are runnning a version of VMS prior
+For this reason if you are running a version of VMS prior
to V7.1 you shouldn't nest the source directory
too deeply in your directory structure lest you exceed RMS'
-maximum of 8 levels of subdirectory in a filespec. (You
-can use rooted logical names to get another 8 levels of
+maximum of 8 levels of subdirectory in a file specification.
+(You can use rooted logical names to get another 8 levels of
nesting, if you can't place the files near the top of
the physical directory structure.)
@@ -194,12 +194,141 @@
interconversion between VMS and Unix syntax; its
documentation provides more details.
-Filenames are, of course, still case-insensitive. For
-consistency, most Perl routines return filespecs using
-lower case letters only, regardless of the case used in
-the arguments passed to them. (This is true only when
-running under VMS; Perl respects the case-sensitivity
-of OSs like Unix.)
+With this test version of Perl, Perl now generally follows the
+setting of the DECC$* feature logicals in the interpretation
+of UNIX pathnames.
+
+Except for handling extended characters, and case sensitivity, as
+long as DECC$POSIX_COMPLIANT_PATHNAMES, DECC$FILENAME_UNIX_REPORT,
+and DECC$FILENAME_UNIX_ONLY are not set, then the older
+perl behavior for conversions of file specifications from UNIX
+to VMS is followed, except that VMS paths with concealed rooted
+logicals are now translated correctly to UNIX paths.
+
+With those features set, then new routines handle the translation,
+because some of the rules are different. The presence of ./.../
+in a UNIX path is no longer translated to the VMS [...]. It will
+translate to [.^.^.^.]. To be compatible with what MakeMaker expects,
+if a VMS path can not be translated to a UNIX path when unixify
+is called, it is passed through unchanged. So unixify("[...]") will
+return "[...]".
+
+The RMS Symbolic Link SDK also introduces a new "^UP^posix/pathname/file"
+syntax that most VMS routines will accept. This test version of Perl
+has modified to understand it when the DECC$POSIX_COMPLIANT_PATHNAMES
+feature is enabled.
+
+The handling of extended characters will also be better in with the
+newer translation routines. But more work is needed to fully support
+extended file syntax names.
+
+There are several ambiguous cases where a conversion routine can not
+determine if an input filename is in UNIX format or in VMS format,
+since now both VMS UNIX file specifications can have characters in
+them that could be mistaken for syntax delimiters of the other type.
+So some pathnames simply can not be used in a mode that allows either
+type of pathname to be present.
+
+Perl will tend to assume that an ambiguous filename is in UNIX format.
+
+Allowing "." as a version delimiter is simply incompatible with
+determining if a pathname is already VMS format or UNIX with the
+extended file syntax. There is no way to know if "perl-5.8.6" that
+TAR produces is a UNIX "perl-5.8.6" or a VMS "perl-5.8;6" when
+passing it to unixify() or vmsify().
+
+The DECC$FILENAME_UNIX_REPORT or the DECC$FILENAME_UNIX_ONLY logical
+names control how Perl interprets filenames.
+
+The DECC$FILENAME_UNIX_ONLY setting has not been tested at this time.
+Perl uses traditional OpenVMS file specifications internally and in
+the test harness, so this mode may have limited use, or require more
+changes to make usable.
+
+Everything about DECC$FILENAME_UNIX_REPORT should be assumed to apply
+to DECC$FILENAME_UNIX_ONLY mode. The DECC$FILENAME_UNIX_ONLY differs
+in that it expects all filenames passed to the C runtime to be already
+in UNIX format.
+
+The logical name DECC$POSIX_COMPLIANT_PATHNAMES is new with the
+RMS Symbolic Link SDK. It takes a value from 0 to 4, where
+0 is the same as disabled. There are only two values that
+are tested to work with this Perl kit, and that is 0 and 3.
+
+DECC$POSIX_COMPLIANT_PATHNAMES currently has the following values:
+ 0 = Default and former CRTL behavior.
+ 1 = CRTL assumes all pathnames are POSIX. Perl would also
+ need DECC$FILENAME_UNIX_ONLY, etc, set. Much of this test
+ version of Perl will not function in this mode on the SDK.
+ 2 = CRTL assumes ambiguous names are UNIX. Much of this test
+ version of Perl will not function in this mode on the SDK.
+ 3 = CRTL assumes ambiguous names are traditional VMS format.
+ 4 = CRTL assumes all names are VMS. As Perl uses UNIX names
+ internally in most places, it is doubtful this mode would
+ be useful to Perl.
+
+The information on the DECC$POSIX_COMPLIANT_PATHNAMES may change when
+the RMS Symbolic Link feature is incorporated as part of OpenVMS.
+
+The DECC$POSIX_COMPLIANT_PATHNAMES setting of 3 has only been
+tested with the DECC$FILENAME_UNIX_REPORT also enabled.
+
+The DECC$FILENAME_UNIX_REPORT setting needs some other DECC feature
+logicals set to have Perl treat files in an expected manor.
+
+These feature logicals are:
+
+ DECC$EFS_CASE_PRESERVE "ENABLE"
+ DECC$EFS_CHARSET "ENABLE"
+ DECC$FILENAME_UNIX_NO_VERSION "ENABLE"
+ DECC$READDIR_DROPDOTNOTYPE "ENABLE"
+
+When in DECC$FILENAME_UNIX_REPORT mode, versions are not available from
+the readdir() family of operations.
+
+Also when in DECC$FILENAME_UNIX_REPORT mode, Perl will handle pathnames
+with no file extension or with a trailing "." differently to resolve
+issues with translation. This is needed to properly handle cases where
+a file extension for a VMS format filename is explicitly specified as
+being blank to prevent a default from being used.
+
+ vmsify("foo") = "foo."
+ vmsify("foo.") = "foo^.."
+ unixify("foo^.) = "foo."
+
+But with unixify("foo."), Perl does not know if that is a POSIX or a
+VMS pathname, so in DECC$FILENAME_UNIX_REPORT mode it should not be
+translated.
+
+Also because of this, it is not practical to translate some pathnames
+from VMS to POSIX and then back to VMS by only using the syntax, as
+the filename in VMS format may have an implied extension, and a pathname
+in POSIX format may be for a directory or a symbolic link.
+
+And the conversion routines are used on files and paths that may not
+exist.
+
+Filenames are case-insensitive on VAX, and on ODS-2 formatted
+volumes on ALPHA and I64.
+
+On ODS-5 volumes filenames are case preserved and on newer
+versions of OpenVMS can be optionally case sensitive.
+
+On ALPHA and I64, Perl now uses the process case sensitivity
+setting to report if the file system is case sensitive.
+
+Perl programs should not assume that VMS is case blind,
+or that filenames will be in lowercase.
+
+If the DECC$EFS_CASE_PRESERVE feature is set, Perl routines will
+return the files specifications as they are found on the disk.
+
+For consistency, when the above feature is clear and when not
+otherwise overridden by DECC feature logicals, most Perl routines
+return file specifications using lower case letters only,
+regardless of the case used in the arguments passed to them.
+(This is true only when running under VMS; Perl respects the
+case-sensitivity of OSs like Unix.)
We've tried to minimize the dependence of Perl library
modules on Unix syntax, but you may find that some of these,
@@ -209,20 +338,25 @@
of this in the Perl distribution itself, please let us know,
so we can try to work around them.
+Also when working on Perl programs on VMS, if you need a syntax
+in a specific operating system format, then you need to either
+check the appropriate DECC$ feature logical, or call a conversion
+routine to force it to that format.
+
=head2 Wildcard expansion
File specifications containing wildcards are allowed both on
the command line and within Perl globs (e.g. C<E<lt>*.cE<gt>>). If
-the wildcard filespec uses VMS syntax, the resultant
-filespecs will follow VMS syntax; if a Unix-style filespec is
-passed in, Unix-style filespecs will be returned.
-Similar to the behavior of wildcard globbing for a Unix shell,
-one can escape command line wildcards with double quotation
-marks C<"> around a perl program command line argument. However,
-owing to the stripping of C<"> characters carried out by the C
-handling of argv you will need to escape a construct such as
-this one (in a directory containing the files F<PERL.C>, F<PERL.EXE>,
-F<PERL.H>, and F<PERL.OBJ>):
+the wildcard file specification uses VMS syntax, the resultant
+file specifications will follow VMS syntax; if a Unix-style
+file specification is passed in, Unix-style file specifications
+will be returned. Similar to the behavior of wildcard globing
+for a Unix shell, one can escape command line wildcards with
+double quotation marks C<"> around a perl program command line
+argument. However, owing to the stripping of C<"> characters
+carried out by the C handling of argv you will need to escape a
+construct such as this one (in a directory containing the files
+F<PERL.C>, F<PERL.EXE>, F<PERL.H>, and F<PERL.OBJ>):
$ perl -e "print join(' ',@ARGV)" perl.*
perl.c perl.exe perl.h perl.obj
@@ -235,21 +369,21 @@
In both the case of unquoted command line arguments or in calls
to C<glob()> VMS wildcard expansion is performed. (csh-style
wildcard expansion is available if you use C<File::Glob::glob>.)
-If the wildcard filespec contains a device or directory
-specification, then the resultant filespecs will also contain
-a device and directory; otherwise, device and directory
-information are removed. VMS-style resultant filespecs will
-contain a full device and directory, while Unix-style
-resultant filespecs will contain only as much of a directory
-path as was present in the input filespec. For example, if
+If the wildcard file specification contains a device or directory
+specification, then the resultant file specifications will also
+contain a device and directory; otherwise, device and directory
+information are removed. VMS-style resultant file specifications
+will contain a full device and directory, while Unix-style
+resultant file specifications will contain only as much of a directory
+path as was present in the input file specification. For example, if
your default directory is Perl_Root:[000000], the expansion
-of C<[.t]*.*> will yield filespecs like
+of C<[.t]*.*> will yield file specifications like
"perl_root:[t]base.dir", while the expansion of C<t/*/*> will
-yield filespecs like "t/base.dir". (This is done to match
+yield file specifications like "t/base.dir". (This is done to match
the behavior of glob expansion performed by Unix shells.)
-Similarly, the resultant filespec will contain the file version
-only if one was present in the input filespec.
+Similarly, the resultant file specification will contain the file version
+only if one was present in the input file specification.
=head2 Pipes
@@ -337,6 +471,10 @@
them in double-quotes on the command line, since the CRTL
downcases all unquoted strings.
+On newer 64 bit versions of OpenVMS, a process setting now
+controls if the quoting is needed to preserve the case of
+command line arguments.
+
=over 4
=item -i
@@ -392,8 +530,9 @@
undef, unlink*, unpack, untie, unshift, use, utime*,
values, vec, wait, waitpid*, wantarray, warn, write, y///
-The following functions were not implemented in the VMS port,
-and calling them produces a fatal error (usually) or
+The following functions were not implemented in the initial
+VMS port, and calling them on a build of Perl that does not
+implemenet them produces a fatal error (usually) or
undefined behavior (rarely, we hope):
chroot, dbmclose, dbmopen, flock, fork*,
@@ -427,6 +566,36 @@
getsockopt, listen, recv, select(system call)*,
send, setsockopt, shutdown, socket
+The following function is available on Perls built on 64 bit OpenVMS 8.2
+with hard links enabled on an ODS-5 formatted build disk. If someone with
+an OpenVMS 7.3-1 system were to modify configure.com and test the results,
+this feature can be brought back to OpenVMS 7.3-1 and later. Hardlinks
+must be enabled on the build disk because if the build procedure sees
+this feature enabled, it uses it.
+
+ link
+
+The following functions are available on Perls built on 64 bit OpenVMS
+8.2 and can be implemented on OpenVMS 7.3-2 if someone were to modify
+configure.com and test the results. (While in the build, at the time
+of this writing, they have not been specifically tested.)
+
+ getgrgid, getgrnam, getpwnam, getpwuid,
+ setgrent, ttyname
+
+The following function is available on Perls built on 64 bit OpenVMS 8.2
+and later. (While in the build, at the time of this writing, they have
+not been specifically tested.)
+
+ statvfs, socketpair
+
+The following functions are available on Perls built on OpenVMS 8.2 or later
+with the RMS Symbolic link package. Use of symbolic links effectively
+requires the DECC$POSIX_COMPLIANT_PATHNAMES to defined as 3, and operating
+in a DECC$FILENAME_UNIX_REPORT mode.
+
+ lchown, link, lstat, readlink, symlink
+
=over 4
=item File tests
@@ -446,6 +615,9 @@
specification without an explicit directory (e.g. C<DUA1:>), as
well as if passed a directory.
+There are DECC feature logicals AND ODS-5 volume attributes that
+also control what values are returned for the date fields.
+
Note: Some sites have reported problems when using the file-access
tests (C<-r>, C<-w>, and C<-x>) on files accessed via DEC's DFS.
Specifically, since DFS does not currently provide access to the
@@ -522,11 +695,11 @@
A call to C<exec> will cause Perl to exit, and to invoke the command
given as an argument to C<exec> via C<lib$do_command>. If the
-argument begins with '@' or '$' (other than as part of a filespec),
+argument begins with '@' or '$' (other than as part of a file specification),
then it is executed as a DCL command. Otherwise, the first token on
-the command line is treated as the filespec of an image to run, and
+the command line is treated as the file specification of an image to run, and
an attempt is made to invoke it (using F<.Exe> and the process
-defaults to expand the filespec) and pass the rest of C<exec>'s
+defaults to expand the file specification) and pass the rest of C<exec>'s
argument to it as parameters. If the token has no file type, and
matches a file with null type, then an attempt is made to determine
whether the file is an executable image which should be invoked
@@ -606,6 +779,11 @@
to be the same for two different files. We can't guarantee this,
though, so caveat scriptor.
+This is being looked at because in 64 bit OpenVMS 8.2 and later
+VMS returns the st_dev and st_ino as UNIX requires. Unfortunately,
+Perl on VMS has a dependency on the old format that can not
+easily be removed in the short term.
+
=item system LIST
The C<system> operator creates a subprocess, and passes its
@@ -697,7 +875,11 @@
Since ODS-2, the VMS file structure for disk files, does not keep
track of access times, this operator changes only the modification
-time of the file (VMS revision date).
+time of the file (VMS revision date) on those volumes.
+
+For ODS-5 volumes, these affects are controlled by a combination of
+volume settings and DECC$ feature logical names.
+
=item waitpid PID,FLAGS
@@ -933,13 +1115,13 @@
SDBM_File works properly on VMS. It has, however, one minor
difference. The database directory file created has a F<.sdbm_dir>
-extension rather than a F<.dir> extension. F<.dir> files are VMS filesystem
+extension rather than a F<.dir> extension. F<.dir> files are VMS file system
directory files, and using them for other purposes could cause unacceptable
problems.
=head1 Revision date
-This document was last updated on 01-May-2002, for Perl 5,
+This document was last updated on 30-Jun-2005, for a test version of Perl 5,
patchlevel 8.
=head1 AUTHOR
@@ -947,3 +1129,4 @@
Charles Bailey [EMAIL PROTECTED]
Craig Berry [EMAIL PROTECTED]
Dan Sugalski [EMAIL PROTECTED]
+John Malmberg [EMAIL PROTECTED]