perlvms.pod
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· POD 代码 · 共 1,224 行 · 第 1/4 页
POD
1,224 行
$ perl -e "print join(' ',@ARGV)" perl.* perl.c perl.exe perl.h perl.objin the following triple quoted manner: $ perl -e "print join(' ',@ARGV)" """perl.*""" perl.*In both the case of unquoted command line arguments or in callsto C<glob()> VMS wildcard expansion is performed. (csh-stylewildcard 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 your default directory is Perl_Root:[000000], the expansion of C<[.t]*.*> will yield filespecs like "perl_root:[t]base.dir", while the expansion of C<t/*/*> will yield filespecs 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 versiononly if one was present in the input filespec.=head2 PipesInput and output pipes to Perl filehandles are supported; the "file name" is passed to lib$spawn() for asynchronous execution. You should be careful to close any pipes you have opened in a Perl script, lest you leave any "orphaned" subprocesses around when Perl exits. You may also use backticks to invoke a DCL subprocess, whose output is used as the return value of the expression. The string between the backticks is handled as if it were theargument to the C<system> operator (see below). In this case,Perl will wait for the subprocess to complete before continuing. The mailbox (MBX) that perl can create to communicate with a pipedefaults to a buffer size of 512. The default buffer size isadjustable via the logical name PERL_MBX_SIZE provided that thevalue falls between 128 and the SYSGEN parameter MAXBUF inclusive.For example, to double the MBX size from the default withina Perl program, use C<$ENV{'PERL_MBX_SIZE'} = 1024;> and thenopen and use pipe constructs. An alternative would be to issuethe command: $ Define PERL_MBX_SIZE 1024before running your wide record pipe program. A larger value mayimprove performance at the expense of the BYTLM UAF quota.=head1 PERL5LIB and PERLLIBThe PERL5LIB and PERLLIB logical names work as documented in L<perl>,except that the element separator is '|' instead of ':'. Thedirectory specifications may use either VMS or Unix syntax.=head1 The Perl Forked DebuggerThe Perl forked debugger places the debugger commands and output in aseparate X-11 terminal window so that commands and output from multipleprocesses are not mixed together.Perl on VMS supports an emulation of the forked debugger when Perl isrun on a VMS system that has X11 support installed.To use the forked debugger, you need to have the default display set to anX-11 Server and some environment variables set that Unix expects.The forked debugger requires the environment variable C<TERM> to be C<xterm>,and the environment variable C<DISPLAY> to exist. C<xterm> must be inlower case. $define TERM "xterm" $define DISPLAY "hostname:0.0"Currently the value of C<DISPLAY> is ignored. It is recommended that it be setto be the hostname of the display, the server and screen in UNIX notation. Inthe future the value of DISPLAY may be honored by Perl instead of using thedefault display.It may be helpful to always use the forked debugger so that script I/O isseparated from debugger I/O. You can force the debugger to be forked byassigning a value to the logical name <PERLDB_PIDS> that is not a processidentification number. $define PERLDB_PIDS XXXX=head1 PERL_VMS_EXCEPTION_DEBUGThe PERL_VMS_EXCEPTION_DEBUG being defined as "ENABLE" will cause the VMSdebugger to be invoked if a fatal exception that is not otherwisehandled is raised. The purpose of this is to allow debugging ofinternal Perl problems that would cause such a condition.This allows the programmer to look at the execution stack and variables tofind out the cause of the exception. As the debugger is being invoked asthe Perl interpreter is about to do a fatal exit, continuing the executionin debug mode is usally not practical.Starting Perl in the VMS debugger may change the program executionprofile in a way that such problems are not reproduced.The C<kill> function can be used to test this functionality from withina program.In typical VMS style, only the first letter of the value of this logicalname is actually checked in a case insensitive mode, and it is consideredenabled if it is the value "T","1" or "E".This logical name must be defined before Perl is started.=head1 Command line=head2 I/O redirection and backgroundingPerl for VMS supports redirection of input and output on the command line, using a subset of Bourne shell syntax:=over 4=item *C<E<lt>file> reads stdin from C<file>,=item *C<E<gt>file> writes stdout to C<file>,=item *C<E<gt>E<gt>file> appends stdout to C<file>,=item *C<2E<gt>file> writes stderr to C<file>,=item *C<2E<gt>E<gt>file> appends stderr to C<file>, and=item *C<< 2>&1 >> redirects stderr to stdout.=backIn addition, output may be piped to a subprocess, using the character '|'. Anything after this character on the command line is passed to a subprocess for execution; the subprocess takes the output of Perl as its input.Finally, if the command line ends with '&', the entire command is run in the background as an asynchronous subprocess.=head2 Command line switchesThe following command line switches behave differently underVMS than described in L<perlrun>. Note also that in orderto pass uppercase switches to Perl, you need to enclosethem in double-quotes on the command line, since the CRTLdowncases all unquoted strings.On newer 64 bit versions of OpenVMS, a process setting nowcontrols if the quoting is needed to preserve the case ofcommand line arguments.=over 4=item -iIf the C<-i> switch is present but no extension for a backupcopy is given, then inplace editing creates a new version ofa file; the existing copy is not deleted. (Note that ifan extension is given, an existing file is renamed to the backupfile, as is the case under other operating systems, so it doesnot remain as a previous version under the original filename.)=item -SIf the C<"-S"> or C<-"S"> switch is present I<and> the scriptname does not contain a directory, then Perl translates thelogical name DCL$PATH as a searchlist, using each translationas a directory in which to look for the script. In addition,if no file type is specified, Perl looks in each directoryfor a file matching the name specified, with a blank type,a type of F<.pl>, and a type of F<.com>, in that order.=item -uThe C<-u> switch causes the VMS debugger to be invokedafter the Perl program is compiled, but before it hasrun. It does not create a core dump file.=back=head1 Perl functionsAs of the time this document was last revised, the following Perl functions were implemented in the VMS port of Perl (functions marked with * are discussed in more detail below): file tests*, abs, alarm, atan, backticks*, binmode*, bless, caller, chdir, chmod, chown, chomp, chop, chr, close, closedir, cos, crypt*, defined, delete, die, do, dump*, each, endgrent, endpwent, eof, eval, exec*, exists, exit, exp, fileno, flock getc, getgrent*, getgrgid*, getgrnam, getlogin, getppid, getpwent*, getpwnam*, getpwuid*, glob, gmtime*, goto, grep, hex, ioctl, import, index, int, join, keys, kill*, last, lc, lcfirst, lchown*, length, link*, local, localtime, log, lstat, m//, map, mkdir, my, next, no, oct, open, opendir, ord, pack, pipe, pop, pos, print, printf, push, q//, qq//, qw//, qx//*, quotemeta, rand, read, readdir, readlink*, redo, ref, rename, require, reset, return, reverse, rewinddir, rindex, rmdir, s///, scalar, seek, seekdir, select(internal), select (system call)*, setgrent, setpwent, shift, sin, sleep, socketpair, sort, splice, split, sprintf, sqrt, srand, stat, study, substr, symlink*, sysread, system*, syswrite, tell, telldir, tie, time, times*, tr///, uc, ucfirst, umask, 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 undefined behavior (rarely, we hope): chroot, dbmclose, dbmopen, fork*, getpgrp, getpriority, msgctl, msgget, msgsend, msgrcv, semctl, semget, semop, setpgrp, setpriority, shmctl, shmget, shmread, shmwrite, syscallThe following functions are available on Perls compiled with Dec C5.2 or greater and running VMS 7.0 or greater: truncateThe following functions are available on Perls built on VMS 7.2 orgreater: fcntl (without locking)The following functions may or may not be implemented, depending on what type of socket support you've built into your copy of Perl: accept, bind, connect, getpeername, gethostbyname, getnetbyname, getprotobyname, getservbyname, gethostbyaddr, getnetbyaddr, getprotobynumber, getservbyport, gethostent, getnetent, getprotoent, getservent, sethostent, setnetent, setprotoent, setservent, endhostent, endnetent, endprotoent, endservent, getsockname, getsockopt, listen, recv, select(system call)*, send, setsockopt, shutdown, socketThe following function is available on Perls built on 64 bit OpenVMS v8.2with hard links enabled on an ODS-5 formatted build disk. CRTL supportis in principle available as of OpenVMS v7.3-1, and better configurationsupport could detect this. linkThe following functions are available on Perls built on 64 bit OpenVMSv8.2 and later. CRTL support is in principle available as of OpenVMSv7.3-2, and better configuration support could detect this. getgrgid, getgrnam, getpwnam, getpwuid, setgrent, ttynameThe following functions are available on Perls built on 64 bit OpenVMS v8.2and later. statvfs, socketpair=over 4=item File testsThe tests C<-b>, C<-B>, C<-c>, C<-C>, C<-d>, C<-e>, C<-f>,C<-o>, C<-M>, C<-s>, C<-S>, C<-t>, C<-T>, and C<-z> work asadvertised. The return values for C<-r>, C<-w>, and C<-x>tell you whether you can actually access the file; this maynot reflect the UIC-based file protections. Since real andeffective UIC don't differ under VMS, C<-O>, C<-R>, C<-W>,and C<-X> are equivalent to C<-o>, C<-r>, C<-w>, and C<-x>.Similarly, several other tests, including C<-A>, C<-g>, C<-k>,C<-l>, C<-p>, and C<-u>, aren't particularly meaningful underVMS, and the values returned by these tests reflect whateveryour CRTL C<stat()> routine does to the equivalent bits in thest_mode field. Finally, C<-d> returns true if passed a devicespecification without an explicit directory (e.g. C<DUA1:>), aswell as if passed a directory.There are DECC feature logical names AND ODS-5 volume attributes thatalso control what values are returned for the date fields.Note: Some sites have reported problems when using the file-access
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?