⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 perl561delta.1

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 1
📖 第 1 页 / 共 5 页
字号:
Trailing new \f(CW%ENV\fR entries weren't propagated to child processes.  Thisis now fixed..IP "\(bu" 4Current directory entries in \f(CW%ENV\fR are now correctly propagated to childprocesses..IP "\(bu" 4Duping socket handles with open(F, \*(L">&MYSOCK\*(R") now works under Windows 9x..IP "\(bu" 4The makefiles now provide a single switch to bulk-enable all the featuresenabled in ActiveState ActivePerl (a popular binary distribution)..IP "\(bu" 4\&\fIWin32::GetCwd()\fR correctly returns C:\e instead of C: when at the drive root.Other bugs in \fIchdir()\fR and \fICwd::cwd()\fR have also been fixed..IP "\(bu" 4\&\fIfork()\fR correctly returns undef and sets \s-1EAGAIN\s0 when it runs out ofpseudo-process handles..IP "\(bu" 4ExtUtils::MakeMaker now uses \f(CW$ENV\fR{\s-1LIB\s0} to search for libraries..IP "\(bu" 4\&\s-1UNC\s0 path handling is better when perl is built to support \fIfork()\fR..IP "\(bu" 4A handle leak in socket handling has been fixed..IP "\(bu" 4\&\fIsend()\fR works from within a pseudo-process..PPUnless specifically qualified otherwise, the remainder of this documentcovers changes between the 5.005 and 5.6.0 releases..SH "Core Enhancements".IX Header "Core Enhancements".Sh "Interpreter cloning, threads, and concurrency".IX Subsection "Interpreter cloning, threads, and concurrency"Perl 5.6.0 introduces the beginnings of support for running multipleinterpreters concurrently in different threads.  In conjunction withthe \fIperl_clone()\fR \s-1API\s0 call, which can be used to selectively duplicatethe state of any given interpreter, it is possible to compile apiece of code once in an interpreter, clone that interpreterone or more times, and run all the resulting interpreters in distinctthreads..PPOn the Windows platform, this feature is used to emulate \fIfork()\fR at theinterpreter level.  See perlfork for details about that..PPThis feature is still in evolution.  It is eventually meant to be usedto selectively clone a subroutine and data reachable from thatsubroutine in a separate interpreter and run the cloned subroutinein a separate thread.  Since there is no shared data between theinterpreters, little or no locking will be needed (unless parts ofthe symbol table are explicitly shared).  This is obviously intendedto be an easy-to-use replacement for the existing threads support..PPSupport for cloning interpreters and interpreter concurrency can beenabled using the \-Dusethreads Configure option (see win32/Makefile forhow to enable it on Windows.)  The resulting perl executable will befunctionally identical to one that was built with \-Dmultiplicity, butthe \fIperl_clone()\fR \s-1API\s0 call will only be available in the former..PP\&\-Dusethreads enables the cpp macro \s-1USE_ITHREADS\s0 by default, which in turnenables Perl source code changes that provide a clear separation betweenthe op tree and the data it operates with.  The former is immutable, andcan therefore be shared between an interpreter and all of its clones,while the latter is considered local to each interpreter, and is thereforecopied for each clone..PPNote that building Perl with the \-Dusemultiplicity Configure optionis adequate if you wish to run multiple \fBindependent\fR interpretersconcurrently in different threads.  \-Dusethreads only provides theadditional functionality of the \fIperl_clone()\fR \s-1API\s0 call and othersupport for running \fBcloned\fR interpreters concurrently..PP.Vb 2\&    NOTE: This is an experimental feature.  Implementation details are\&    subject to change..Ve.Sh "Lexically scoped warning categories".IX Subsection "Lexically scoped warning categories"You can now control the granularity of warnings emitted by perl at a finerlevel using the \f(CW\*(C`use warnings\*(C'\fR pragma.  warnings and perllexwarnhave copious documentation on this feature..Sh "Unicode and \s-1UTF\-8\s0 support".IX Subsection "Unicode and UTF-8 support"Perl now uses \s-1UTF\-8\s0 as its internal representation for characterstrings.  The \f(CW\*(C`utf8\*(C'\fR and \f(CW\*(C`bytes\*(C'\fR pragmas are used to control this supportin the current lexical scope.  See perlunicode, utf8 and bytes formore information..PPThis feature is expected to evolve quickly to support some form of I/Odisciplines that can be used to specify the kind of input and output data(bytes or characters).  Until that happens, additional modules from \s-1CPAN\s0will be needed to complete the toolkit for dealing with Unicode..PP.Vb 2\&    NOTE: This should be considered an experimental feature.  Implementation\&    details are subject to change..Ve.Sh "Support for interpolating named characters".IX Subsection "Support for interpolating named characters"The new \f(CW\*(C`\eN\*(C'\fR escape interpolates named characters within strings.For example, \f(CW"Hi! \eN{WHITE SMILING FACE}"\fR evaluates to a stringwith a Unicode smiley face at the end..ie n .Sh """our"" declarations".el .Sh "``our'' declarations".IX Subsection "our declarations"An \*(L"our\*(R" declaration introduces a value that can be best understoodas a lexically scoped symbolic alias to a global variable in thepackage that was current where the variable was declared.  This ismostly useful as an alternative to the \f(CW\*(C`vars\*(C'\fR pragma, but also providesthe opportunity to introduce typing and other attributes for suchvariables.  See \*(L"our\*(R" in perlfunc..Sh "Support for strings represented as a vector of ordinals".IX Subsection "Support for strings represented as a vector of ordinals"Literals of the form \f(CW\*(C`v1.2.3.4\*(C'\fR are now parsed as a string composedof characters with the specified ordinals.  This is an alternative, morereadable way to construct (possibly Unicode) strings instead ofinterpolating characters, as in \f(CW"\ex{1}\ex{2}\ex{3}\ex{4}"\fR.  The leading\&\f(CW\*(C`v\*(C'\fR may be omitted if there are more than two ordinals, so \f(CW1.2.3\fR isparsed the same as \f(CW\*(C`v1.2.3\*(C'\fR..PPStrings written in this form are also useful to represent version \*(L"numbers\*(R".It is easy to compare such version \*(L"numbers\*(R" (which are really just plainstrings) using any of the usual string comparison operators \f(CW\*(C`eq\*(C'\fR, \f(CW\*(C`ne\*(C'\fR,\&\f(CW\*(C`lt\*(C'\fR, \f(CW\*(C`gt\*(C'\fR, etc., or perform bitwise string operations on them using \f(CW\*(C`|\*(C'\fR,\&\f(CW\*(C`&\*(C'\fR, etc..PPIn conjunction with the new \f(CW$^V\fR magic variable (which containsthe perl version as a string), such literals can be used as a readable wayto check if you're running a particular version of Perl:.PP.Vb 4\&    # this will parse in older versions of Perl also\&    if ($^V and $^V gt v5.6.0) {\&        # new features supported\&    }.Ve.PP\&\f(CW\*(C`require\*(C'\fR and \f(CW\*(C`use\*(C'\fR also have some special magic to support such literals.They will be interpreted as a version rather than as a module name:.PP.Vb 2\&    require v5.6.0;             # croak if $^V lt v5.6.0\&    use v5.6.0;                 # same, but croaks at compile\-time.Ve.PPAlternatively, the \f(CW\*(C`v\*(C'\fR may be omitted if there is more than one dot:.PP.Vb 2\&    require 5.6.0;\&    use 5.6.0;.Ve.PPAlso, \f(CW\*(C`sprintf\*(C'\fR and \f(CW\*(C`printf\*(C'\fR support the Perl-specific format flag \f(CW%v\fRto print ordinals of characters in arbitrary strings:.PP.Vb 3\&    printf "v%vd", $^V;         # prints current version, such as "v5.5.650"\&    printf "%*vX", ":", $addr;  # formats IPv6 address\&    printf "%*vb", " ", $bits;  # displays bitstring.Ve.PPSee \*(L"Scalar value constructors\*(R" in perldata for additional information..Sh "Improved Perl version numbering system".IX Subsection "Improved Perl version numbering system"Beginning with Perl version 5.6.0, the version number convention has beenchanged to a \*(L"dotted integer\*(R" scheme that is more commonly found in opensource projects..PPMaintenance versions of v5.6.0 will be released as v5.6.1, v5.6.2 etc.The next development series following v5.6.0 will be numbered v5.7.x,beginning with v5.7.0, and the next major production release followingv5.6.0 will be v5.8.0..PPThe English module now sets \f(CW$PERL_VERSION\fR to $^V (a string value) ratherthan \f(CW$]\fR (a numeric value).  (This is a potential incompatibility.Send us a report via perlbug if you are affected by this.).PPThe v1.2.3 syntax is also now legal in Perl.See \*(L"Support for strings represented as a vector of ordinals\*(R" for more on that..PPTo cope with the new versioning system's use of at least three significantdigits for each version component, the method used for incrementing thesubversion number has also changed slightly.  We assume that versions olderthan v5.6.0 have been incrementing the subversion component in multiples of10.  Versions after v5.6.0 will increment them by 1.  Thus, using the newnotation, 5.005_03 is the \*(L"same\*(R" as v5.5.30, and the first maintenanceversion following v5.6.0 will be v5.6.1 (which should be read as beingequivalent to a floating point value of 5.006_001 in the older format,stored in \f(CW$]\fR)..Sh "New syntax for declaring subroutine attributes".IX Subsection "New syntax for declaring subroutine attributes"Formerly, if you wanted to mark a subroutine as being a method call oras requiring an automatic \fIlock()\fR when it is entered, you had to declarethat with a \f(CW\*(C`use attrs\*(C'\fR pragma in the body of the subroutine.That can now be accomplished with declaration syntax, like this:.PP.Vb 5\&    sub mymethod : locked method;\&    ...\&    sub mymethod : locked method {\&        ...\&    }\&\&    sub othermethod :locked :method;\&    ...\&    sub othermethod :locked :method {\&        ...\&    }.Ve.PP(Note how only the first \f(CW\*(C`:\*(C'\fR is mandatory, and whitespace surroundingthe \f(CW\*(C`:\*(C'\fR is optional.).PP\&\fIAutoSplit.pm\fR and \fISelfLoader.pm\fR have been updated to keep the attributeswith the stubs they provide.  See attributes..Sh "File and directory handles can be autovivified".IX Subsection "File and directory handles can be autovivified"Similar to how constructs such as \f(CW\*(C`$x\->[0]\*(C'\fR autovivify a reference,handle constructors (\fIopen()\fR, \fIopendir()\fR, \fIpipe()\fR, \fIsocketpair()\fR, \fIsysopen()\fR,\&\fIsocket()\fR, and \fIaccept()\fR) now autovivify a file or directory handleif the handle passed to them is an uninitialized scalar variable.  Thisallows the constructs such as \f(CW\*(C`open(my $fh, ...)\*(C'\fR and \f(CW\*(C`open(local $fh,...)\*(C'\fRto be used to create filehandles that will conveniently be closedautomatically when the scope ends, provided there are no other referencesto them.  This largely eliminates the need for typeglobs when openingfilehandles that must be passed around, as in the following example:.PP.Vb 5\&    sub myopen {\&        open my $fh, "@_"\&             or die "Can\*(Aqt open \*(Aq@_\*(Aq: $!";\&        return $fh;\&    }\&\&    {\&        my $f = myopen("</etc/motd");\&        print <$f>;\&        # $f implicitly closed here\&    }.Ve.Sh "\fIopen()\fP with more than two arguments".IX Subsection "open() with more than two arguments"If \fIopen()\fR is passed three arguments instead of two, the second argumentis used as the mode and the third argument is taken to be the file name.This is primarily useful for protecting against unintended magic behaviorof the traditional two-argument form.  See \*(L"open\*(R" in perlfunc..Sh "64\-bit support".IX Subsection "64-bit support"Any platform that has 64\-bit integers either.PP.Vb 3\&        (1) natively as longs or ints\&        (2) via special compiler flags\&        (3) using long long or int64_t.Ve.PPis able to use \*(L"quads\*(R" (64\-bit integers) as follows:.IP "\(bu" 4constants (decimal, hexadecimal, octal, binary) in the code.IP "\(bu" 4arguments to \fIoct()\fR and \fIhex()\fR.IP "\(bu" 4arguments to \fIprint()\fR, \fIprintf()\fR and \fIsprintf()\fR (flag prefixes ll, L, q).IP "\(bu" 4printed as such.IP "\(bu" 4\&\fIpack()\fR and \fIunpack()\fR \*(L"q\*(R" and \*(L"Q\*(R" formats.IP "\(bu" 4in basic arithmetics: + \- * / % (\s-1NOTE:\s0 operating close to the limitsof the integer values may produce surprising results).IP "\(bu" 4in bit arithmetics: & | ^ ~ << >> (\s-1NOTE:\s0 these used to be forced to be 32 bits wide but now operate on the full native width.).IP "\(bu" 4\&\fIvec()\fR.PPNote that unless you have the case (a) you will have to configureand compile Perl using the \-Duse64bitint Configure flag..PP.Vb 2\&    NOTE: The Configure flags \-Duselonglong and \-Duse64bits have been\&    deprecated.  Use \-Duse64bitint instead..Ve.PPThere are actually two modes of 64\-bitness: the first one is achievedusing Configure \-Duse64bitint and the second one using Configure\&\-Duse64bitall.  The difference is that the first one is minimal andthe second one maximal.  The first works in more places than the second..PPThe \f(CW\*(C`use64bitint\*(C'\fR does only as much as is required to get 64\-bitintegers into Perl (this may mean, for example, using \*(L"long longs\*(R")while your memory may still be limited to 2 gigabytes (because yourpointers could still be 32\-bit).  Note that the name \f(CW\*(C`64bitint\*(C'\fR doesnot imply that your C compiler will be using 64\-bit \f(CW\*(C`int\*(C'\fRs (it might,but it doesn't have to): the \f(CW\*(C`use64bitint\*(C'\fR means that you will beable to have 64 bits wide scalar values..PPThe \f(CW\*(C`use64bitall\*(C'\fR goes all the way by attempting to switch alsointegers (if it can), longs (and pointers) to being 64\-bit.  This maycreate an even more binary incompatible Perl than \-Duse64bitint: theresulting executable may not run at all in a 32\-bit box, or you mayhave to reboot/reconfigure/rebuild your operating system to be 64\-bit

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -