perlport.pod
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· POD 代码 · 共 1,586 行 · 第 1/5 页
POD
1,586 行
The Cygwin environment for Win32; F<README.cygwin> (installed as L<perlcygwin>), http://www.cygwin.com/=item *The U/WIN environment for Win32,http://www.research.att.com/sw/tools/uwin/=item *Build instructions for OS/2, L<perlos2>=back=head2 S<Mac OS>Any module requiring XS compilation is right out for most people, becauseMacPerl is built using non-free (and non-cheap!) compilers. Some XSmodules that can work with MacPerl are built and distributed in binaryform on CPAN.Directories are specified as: volume:folder:file for absolute pathnames volume:folder: for absolute pathnames :folder:file for relative pathnames :folder: for relative pathnames :file for relative pathnames file for relative pathnamesFiles are stored in the directory in alphabetical order. Filenames arelimited to 31 characters, and may include any character except fornull and C<:>, which is reserved as the path separator.Instead of C<flock>, see C<FSpSetFLock> and C<FSpRstFLock> in theMac::Files module, or C<chmod(0444, ...)> and C<chmod(0666, ...)>.In the MacPerl application, you can't run a program from the command line;programs that expect C<@ARGV> to be populated can be edited with somethinglike the following, which brings up a dialog box asking for the commandline arguments. if (!@ARGV) { @ARGV = split /\s+/, MacPerl::Ask('Arguments?'); }A MacPerl script saved as a "droplet" will populate C<@ARGV> with the fullpathnames of the files dropped onto the script.Mac users can run programs under a type of command line interfaceunder MPW (Macintosh Programmer's Workshop, a free developmentenvironment from Apple). MacPerl was first introduced as an MPWtool, and MPW can be used like a shell: perl myscript.plx some argumentsToolServer is another app from Apple that provides access to MPW toolsfrom MPW and the MacPerl app, which allows MacPerl programs to useC<system>, backticks, and piped C<open>."S<Mac OS>" is the proper name for the operating system, but the valuein C<$^O> is "MacOS". To determine architecture, version, or whetherthe application or MPW tool version is running, check: $is_app = $MacPerl::Version =~ /App/; $is_tool = $MacPerl::Version =~ /MPW/; ($version) = $MacPerl::Version =~ /^(\S+)/; $is_ppc = $MacPerl::Architecture eq 'MacPPC'; $is_68k = $MacPerl::Architecture eq 'Mac68K';S<Mac OS X>, based on NeXT's OpenStep OS, runs MacPerl natively, under the"Classic" environment. There is no "Carbon" version of MacPerl to rununder the primary Mac OS X environment. S<Mac OS X> and its Open Sourceversion, Darwin, both run Unix perl natively.Also see:=over 4=item *MacPerl Development, http://dev.macperl.org/ .=item *The MacPerl Pages, http://www.macperl.com/ .=item *The MacPerl mailing lists, http://lists.perl.org/ .=item *MPW, ftp://ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/=back=head2 VMSPerl on VMS is discussed in L<perlvms> in the perl distribution.The official name of VMS as of this writing is OpenVMS.Perl on VMS can accept either VMS- or Unix-style filespecifications as in either of the following: $ perl -ne "print if /perl_setup/i" SYS$LOGIN:LOGIN.COM $ perl -ne "print if /perl_setup/i" /sys$login/login.combut not a mixture of both as in: $ perl -ne "print if /perl_setup/i" sys$login:/login.com Can't open sys$login:/login.com: file specification syntax errorInteracting with Perl from the Digital Command Language (DCL) shelloften requires a different set of quotation marks than Unix shells do.For example: $ perl -e "print ""Hello, world.\n""" Hello, world.There are several ways to wrap your perl scripts in DCL F<.COM> files, ifyou are so inclined. For example: $ write sys$output "Hello from DCL!" $ if p1 .eqs. "" $ then perl -x 'f$environment("PROCEDURE") $ else perl -x - 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8 $ deck/dollars="__END__" #!/usr/bin/perl print "Hello from Perl!\n"; __END__ $ endifDo take care with C<$ ASSIGN/nolog/user SYS$COMMAND: SYS$INPUT> if yourperl-in-DCL script expects to do things like C<< $read = <STDIN>; >>.The VMS operating system has two filesystems, known as ODS-2 and ODS-5.For ODS-2, filenames are in the format "name.extension;version". Themaximum length for filenames is 39 characters, and the maximum length forextensions is also 39 characters. Version is a number from 1 to32767. Valid characters are C</[A-Z0-9$_-]/>.The ODS-2 filesystem is case-insensitive and does not preserve case.Perl simulates this by converting all filenames to lowercase internally.For ODS-5, filenames may have almost any character in them and can includeUnicode characters. Characters that could be misinterpreted by the DCLshell or file parsing utilities need to be prefixed with the C<^>character, or replaced with hexadecimal characters prefixed with theC<^> character. Such prefixing is only needed with the pathnames arein VMS format in applications. Programs that can accept the UNIX formatof pathnames do not need the escape characters. The maximum length forfilenames is 255 characters. The ODS-5 file system can handle botha case preserved and a case sensitive mode.ODS-5 is only available on the OpenVMS for 64 bit platforms.Support for the extended file specifications is being done as optionalsettings to preserve backward compatibility with Perl scripts thatassume the previous VMS limitations.In general routines on VMS that get a UNIX format file specificationshould return it in a UNIX format, and when they get a VMS formatspecification they should return a VMS format unless they are documentedto do a conversion.For routines that generate return a file specification, VMS allows settingif the C library which Perl is built on if it will be returned in VMSformat or in UNIX format.With the ODS-2 file system, there is not much difference in syntax offilenames without paths for VMS or UNIX. With the extended characterset available with ODS-5 there can be a significant difference.Because of this, existing Perl scripts written for VMS were sometimestreating VMS and UNIX filenames interchangeably. Without the extendedcharacter set enabled, this behavior will mostly be maintained forbackwards compatibility.When extended characters are enabled with ODS-5, the handling ofUNIX formatted file specifications is to that of a UNIX system.VMS file specifications without extensions have a trailing dot. Anequivalent UNIX file specification should not show the trailing dot.The result of all of this, is that for VMS, for portable scripts, youcan not depend on Perl to present the filenames in lowercase, to becase sensitive, and that the filenames could be returned in eitherUNIX or VMS format.And if a routine returns a file specification, unless it is intended toconvert it, it should return it in the same format as it found it.C<readdir> by default has traditionally returned lowercased filenames.When the ODS-5 support is enabled, it will return the exact case of thefilename on the disk.Files without extensions have a trailing period on them, so doing aC<readdir> in the default mode with a file named F<A.;5> willreturn F<a.> when VMS is (though that file could be opened withC<open(FH, 'A')>).With support for extended file specifications and if C<opendir> wasgiven a UNIX format directory, a file named F<A.;5> will return F<a>and optionally in the exact case on the disk. When C<opendir> is givena VMS format directory, then C<readdir> should return F<a.>, andagain with the optionally the exact case.RMS had an eight level limit on directory depths from any rooted logical(allowing 16 levels overall) prior to VMS 7.2, and even with versions ofVMS on VAX up through 7.3. Hence C<PERL_ROOT:[LIB.2.3.4.5.6.7.8]> is avalid directory specification but C<PERL_ROOT:[LIB.2.3.4.5.6.7.8.9]> isnot. F<Makefile.PL> authors might have to take this into account, but atleast they can refer to the former as C</PERL_ROOT/lib/2/3/4/5/6/7/8/>.Pumpkings and module integrators can easily see whether files with too manydirectory levels have snuck into the core by running the following in thetop-level source directory: $ perl -ne "$_=~s/\s+.*//; print if scalar(split /\//) > 8;" < MANIFESTThe VMS::Filespec module, which gets installed as part of the buildprocess on VMS, is a pure Perl module that can easily be installed onnon-VMS platforms and can be helpful for conversions to and from RMSnative formats. It is also now the only way that you should check tosee if VMS is in a case sensitive mode.What C<\n> represents depends on the type of file opened. It usuallyrepresents C<\012> but it could also be C<\015>, C<\012>, C<\015\012>, C<\000>, C<\040>, or nothing depending on the file organization and record format. The VMS::Stdio module provides access to the special fopen() requirements of files with unusual attributes on VMS.TCP/IP stacks are optional on VMS, so socket routines might not beimplemented. UDP sockets may not be supported.The TCP/IP library support for all current versions of VMS is dynamicallyloaded if present, so even if the routines are configured, they mayreturn a status indicating that they are not implemented.The value of C<$^O> on OpenVMS is "VMS". To determine the architecturethat you are running on without resorting to loading all of C<%Config>you can examine the content of the C<@INC> array like so: if (grep(/VMS_AXP/, @INC)) { print "I'm on Alpha!\n"; } elsif (grep(/VMS_VAX/, @INC)) { print "I'm on VAX!\n"; } elsif (grep(/VMS_IA64/, @INC)) { print "I'm on IA64!\n"; } else { print "I'm not so sure about where $^O is...\n"; }In general, the significant differences should only be if Perl is runningon VMS_VAX or one of the 64 bit OpenVMS platforms.On VMS, perl determines the UTC offset from the C<SYS$TIMEZONE_DIFFERENTIAL>logical name. Although the VMS epoch began at 17-NOV-1858 00:00:00.00,calls to C<localtime> are adjusted to count offsets from01-JAN-1970 00:00:00.00, just like Unix.Also see:=over 4=item *F<README.vms> (installed as L<README_vms>), L<perlvms>=item *vmsperl list, vmsperl-subscribe@perl.org=item *vmsperl on the web, http://www.sidhe.org/vmsperl/index.html=back=head2 VOSPerl on VOS is discussed in F<README.vos> in the perl distribution(installed as L<perlvos>). Perl on VOS can accept either VOS- orUnix-style file specifications as in either of the following: C<< $ perl -ne "print if /perl_setup/i" >system>notices >> C<< $ perl -ne "print if /perl_setup/i" /system/notices >>or even a mixture of both as in: C<< $ perl -ne "print if /perl_setup/i" >system/notices >>Even though VOS allows the slash character to appear in objectnames, because the VOS port of Perl interprets it as a pathnamedelimiting character, VOS files, directories, or links whose namescontain a slash character cannot be processed. Such files must berenamed before they can be processed by Perl. Note that VOS limitsfile names to 32 or fewer characters.The value of C<$^O> on VOS is "VOS". To determine the architecture thatyou are running on without resorting to loading all of C<%Config> youcan examine the content of the @INC array like so: if ($^O =~ /VOS/) { print "I'm on a Stratus box!\n"; } else { print "I'm not on a Stratus box!\n"; die;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?