📄 perl595delta.1
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...de Sp \" Vertical space (when we can't use .PP).if t .sp .5v.if n .sp...de Vb \" Begin verbatim text.ft CW.nf.ne \\$1...de Ve \" End verbatim text.ft R.fi...\" Set up some character translations and predefined strings. \*(-- will.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left.\" double quote, and \*(R" will give a right double quote. \*(C+ will.\" give a nicer C++. Capital omega is used to do unbreakable dashes and.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,.\" nothing in troff, for use with C<>..tr \(*W-.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'.ie n \{\. ds -- \(*W-. ds PI pi. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch. ds L" "". ds R" "". ds C` "". ds C' ""'br\}.el\{\. ds -- \|\(em\|. ds PI \(*p. ds L" ``. ds R" '''br\}.\".\" Escape single quotes in literal strings from groff's Unicode transform..ie \n(.g .ds Aq \(aq.el .ds Aq '.\".\" If the F register is turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD. Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\. de IX. tm Index:\\$1\t\\n%\t"\\$2"... nr % 0. rr F.\}.el \{\. de IX...\}.\".\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2)..\" Fear. Run. Save yourself. No user-serviceable parts.. \" fudge factors for nroff and troff.if n \{\. ds #H 0. ds #V .8m. ds #F .3m. ds #[ \f1. ds #] \fP.\}.if t \{\. ds #H ((1u-(\\\\n(.fu%2u))*.13m). ds #V .6m. ds #F 0. ds #[ \&. ds #] \&.\}. \" simple accents for nroff and troff.if n \{\. ds ' \&. ds ` \&. ds ^ \&. ds , \&. ds ~ ~. ds /.\}.if t \{\. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u". ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'.\}. \" troff and (daisy-wheel) nroff accents.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'.ds 8 \h'\*(#H'\(*b\h'-\*(#H'.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#].ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#].ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#].ds ae a\h'-(\w'a'u*4/10)'e.ds Ae A\h'-(\w'A'u*4/10)'E. \" corrections for vroff.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'. \" for low resolution devices (crt and lpr).if \n(.H>23 .if \n(.V>19 \\{\. ds : e. ds 8 ss. ds o a. ds d- d\h'-1'\(ga. ds D- D\h'-1'\(hy. ds th \o'bp'. ds Th \o'LP'. ds ae ae. ds Ae AE.\}.rm #[ #] #H #V #F C.\" ========================================================================.\".IX Title "PERL595DELTA 1".TH PERL595DELTA 1 "2007-12-18" "perl v5.10.0" "Perl Programmers Reference Guide".\" For nroff, turn off justification. Always turn off hyphenation; it makes.\" way too many mistakes in technical documents..if n .ad l.nh.SH "NAME"perl595delta \- what is new for perl v5.9.5.SH "DESCRIPTION".IX Header "DESCRIPTION"This document describes differences between the 5.9.4 and the 5.9.5development releases. See perl590delta, perl591delta,perl592delta, perl593delta and perl594delta for the differencesbetween 5.8.0 and 5.9.4..SH "Incompatible Changes".IX Header "Incompatible Changes".Sh "Tainting and printf".IX Subsection "Tainting and printf"When perl is run under taint mode, \f(CW\*(C`printf()\*(C'\fR and \f(CW\*(C`sprintf()\*(C'\fR will nowreject any tainted format argument. (Rafael Garcia-Suarez).Sh "undef and signal handlers".IX Subsection "undef and signal handlers"Undefining or deleting a signal handler via \f(CW\*(C`undef $SIG{FOO}\*(C'\fR is nowequivalent to setting it to \f(CW\*(AqDEFAULT\*(Aq\fR. (Rafael).Sh "strictures and array/hash dereferencing in \fIdefined()\fP".IX Subsection "strictures and array/hash dereferencing in defined()"\&\f(CW\*(C`defined @$foo\*(C'\fR and \f(CW\*(C`defined %$bar\*(C'\fR are now subject to \f(CW\*(C`strict \*(Aqrefs\*(Aq\*(C'\fR(that is, \f(CW$foo\fR and \f(CW$bar\fR shall be proper references there.)(Nicholas Clark).PP(However, \f(CW\*(C`defined(@foo)\*(C'\fR and \f(CW\*(C`defined(%bar)\*(C'\fR are discouraged constructsanyway.).ie n .Sh """(?p{})"" has been removed".el .Sh "\f(CW(?p{})\fP has been removed".IX Subsection "(?p{}) has been removed"The regular expression construct \f(CW\*(C`(?p{})\*(C'\fR, which was deprecated in perl5.8, has been removed. Use \f(CW\*(C`(??{})\*(C'\fR instead. (Rafael).Sh "Pseudo-hashes have been removed".IX Subsection "Pseudo-hashes have been removed"Support for pseudo-hashes has been removed from Perl 5.9. (The \f(CW\*(C`fields\*(C'\fRpragma remains here, but uses an alternate implementation.).Sh "Removal of the bytecode compiler and of perlcc".IX Subsection "Removal of the bytecode compiler and of perlcc"\&\f(CW\*(C`perlcc\*(C'\fR, the byteloader and the supporting modules (B::C, B::CC,B::Bytecode, etc.) are no longer distributed with the perl sources. Thoseexperimental tools have never worked reliably, and, due to the lack ofvolunteers to keep them in line with the perl interpreter developments, itwas decided to remove them instead of shipping a broken version of those.The last version of those modules can be found with perl 5.9.4..PPHowever the B compiler framework stays supported in the perl core, as withthe more useful modules it has permitted (among others, B::Deparse andB::Concise)..Sh "Removal of the \s-1JPL\s0".IX Subsection "Removal of the JPL"The \s-1JPL\s0 (Java-Perl Linguo) has been removed from the perl sources tarball..Sh "Recursive inheritance detected earlier".IX Subsection "Recursive inheritance detected earlier"Perl will now immediately throw an exception if you modify any package's\&\f(CW@ISA\fR in such a way that it would cause recursive inheritance..PPPreviously, the exception would not occur until Perl attempted to makeuse of the recursive inheritance while resolving a method or doing a\&\f(CW\*(C`$foo\->isa($bar)\*(C'\fR lookup..SH "Core Enhancements".IX Header "Core Enhancements".Sh "Regular expressions".IX Subsection "Regular expressions".IP "Recursive Patterns" 4.IX Item "Recursive Patterns"It is now possible to write recursive patterns without using the \f(CW\*(C`(??{})\*(C'\fRconstruct. This new way is more efficient, and in many cases easier toread..SpEach capturing parenthesis can now be treated as an independent patternthat can be entered by using the \f(CW\*(C`(?PARNO)\*(C'\fR syntax (\f(CW\*(C`PARNO\*(C'\fR standing for\&\*(L"parenthesis number\*(R"). For example, the following pattern will matchnested balanced angle brackets:.Sp.Vb 10\& /\& ^ # start of line\& ( # start capture buffer 1\& < # match an opening angle bracket\& (?: # match one of:\& (?> # don\*(Aqt backtrack over the inside of this group\& [^<>]+ # one or more non angle brackets\& ) # end non backtracking group\& | # ... or ...\& (?1) # recurse to bracket 1 and try it again\& )* # 0 or more times.\& > # match a closing angle bracket\& ) # end capture buffer one\& $ # end of line\& /x.Ve.SpNote, users experienced with \s-1PCRE\s0 will find that the Perl implementationof this feature differs from the \s-1PCRE\s0 one in that it is possible tobacktrack into a recursed pattern, whereas in \s-1PCRE\s0 the recursion isatomic or \*(L"possessive\*(R" in nature. (Yves Orton).IP "Named Capture Buffers" 4.IX Item "Named Capture Buffers"It is now possible to name capturing parenthesis in a pattern and refer tothe captured contents by name. The naming syntax is \f(CW\*(C`(?<NAME>....)\*(C'\fR.It's possible to backreference to a named buffer with the \f(CW\*(C`\ek<NAME>\*(C'\fRsyntax. In code, the new magical hashes \f(CW\*(C`%+\*(C'\fR and \f(CW\*(C`%\-\*(C'\fR can be used toaccess the contents of the capture buffers..SpThus, to replace all doubled chars, one could write.Sp.Vb 1\& s/(?<letter>.)\ek<letter>/$+{letter}/g.Ve.SpOnly buffers with defined contents will be \*(L"visible\*(R" in the \f(CW\*(C`%+\*(C'\fR hash, soit's possible to do something like.Sp.Vb 3\& foreach my $name (keys %+) {\& print "content of buffer \*(Aq$name\*(Aq is $+{$name}\en";\& }.Ve.SpThe \f(CW\*(C`%\-\*(C'\fR hash is a bit more complete, since it will contain array refsholding values from all capture buffers similarly named, if there shouldbe many of them..Sp\&\f(CW\*(C`%+\*(C'\fR and \f(CW\*(C`%\-\*(C'\fR are implemented as tied hashes through the new module\&\f(CW\*(C`Tie::Hash::NamedCapture\*(C'\fR..SpUsers exposed to the .NET regex engine will find that the perlimplementation differs in that the numerical ordering of the buffersis sequential, and not \*(L"unnamed first, then named\*(R". Thus in the pattern.Sp.Vb 1\& /(A)(?<B>B)(C)(?<D>D)/.Ve.Sp\&\f(CW$1\fR will be 'A', \f(CW$2\fR will be 'B', \f(CW$3\fR will be 'C' and \f(CW$4\fR will be 'D' and not\&\f(CW$1\fR is 'A', \f(CW$2\fR is 'C' and \f(CW$3\fR is 'B' and \f(CW$4\fR is 'D' that a .NET programmerwould expect. This is considered a feature. :\-) (Yves Orton).IP "Possessive Quantifiers" 4.IX Item "Possessive Quantifiers"Perl now supports the \*(L"possessive quantifier\*(R" syntax of the \*(L"atomic match\*(R"pattern. Basically a possessive quantifier matches as much as it can and nevergives any back. Thus it can be used to control backtracking. The syntax issimilar to non-greedy matching, except instead of using a '?' as the modifierthe '+' is used. Thus \f(CW\*(C`?+\*(C'\fR, \f(CW\*(C`*+\*(C'\fR, \f(CW\*(C`++\*(C'\fR, \f(CW\*(C`{min,max}+\*(C'\fR are now legalquantifiers. (Yves Orton).IP "Backtracking control verbs" 4.IX Item "Backtracking control verbs"The regex engine now supports a number of special-purpose backtrackcontrol verbs: (*THEN), (*PRUNE), (*MARK), (*SKIP), (*COMMIT), (*FAIL)and (*ACCEPT). See perlre for their descriptions. (Yves Orton).IP "Relative backreferences" 4.IX Item "Relative backreferences"A new syntax \f(CW\*(C`\eg{N}\*(C'\fR or \f(CW\*(C`\egN\*(C'\fR where \*(L"N\*(R" is a decimal integer allows asafer form of back-reference notation as well as allowing relativebackreferences. This should make it easier to generate and embed patternsthat contain backreferences. See \*(L"Capture buffers\*(R" in perlre. (Yves Orton).ie n .IP """\eK"" escape" 4.el .IP "\f(CW\eK\fR escape" 4.IX Item "K escape"The functionality of Jeff Pinyan's module Regexp::Keep has been added tothe core. You can now use in regular expressions the special escape \f(CW\*(C`\eK\*(C'\fRas a way to do something like floating length positive lookbehind. It isalso useful in substitutions like:.Sp.Vb 1\& s/(foo)bar/$1/g.Ve.Spthat can now be converted to.Sp.Vb 1\& s/foo\eKbar//g.Ve.Spwhich is much more efficient. (Yves Orton).IP "Vertical and horizontal whitespace, and linebreak" 4.IX Item "Vertical and horizontal whitespace, and linebreak"Regular expressions now recognize the \f(CW\*(C`\ev\*(C'\fR and \f(CW\*(C`\eh\*(C'\fR escapes, that matchvertical and horizontal whitespace, respectively. \f(CW\*(C`\eV\*(C'\fR and \f(CW\*(C`\eH\*(C'\fRlogically match their complements..Sp\&\f(CW\*(C`\eR\*(C'\fR matches a generic linebreak, that is, vertical whitespace, plusthe multi-character sequence \f(CW"\ex0D\ex0A"\fR..ie n .Sh "The ""_"" prototype".el .Sh "The \f(CW_\fP prototype".IX Subsection "The _ prototype"A new prototype character has been added. \f(CW\*(C`_\*(C'\fR is equivalent to \f(CW\*(C`$\*(C'\fR (itdenotes a scalar), but defaults to \f(CW$_\fR if the corresponding argumentisn't supplied. Due to the optional nature of the argument, you can onlyuse it at the end of a prototype, or before a semicolon..PPThis has a small incompatible consequence: the \fIprototype()\fR function hasbeen adjusted to return \f(CW\*(C`_\*(C'\fR for some built-ins in appropriate cases (for
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -