Current Path : /usr/opt/perl530/man/man1/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //usr/opt/perl530/man/man1/perl5100delta.1 |
.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .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" '' . ds C` . ds C' '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 >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" 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 "PERL5100DELTA 1" .TH PERL5100DELTA 1 "2019-10-24" "perl v5.30.2" "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" perl5100delta \- what is new for perl 5.10.0 .SH "DESCRIPTION" .IX Header "DESCRIPTION" This document describes the differences between the 5.8.8 release and the 5.10.0 release. .PP Many of the bug fixes in 5.10.0 were already seen in the 5.8.X maintenance releases; they are not duplicated here and are documented in the set of man pages named perl58[1\-8]?delta. .SH "Core Enhancements" .IX Header "Core Enhancements" .ie n .SS "The ""feature"" pragma" .el .SS "The \f(CWfeature\fP pragma" .IX Subsection "The feature pragma" The \f(CW\*(C`feature\*(C'\fR pragma is used to enable new syntax that would break Perl's backwards-compatibility with older releases of the language. It's a lexical pragma, like \f(CW\*(C`strict\*(C'\fR or \f(CW\*(C`warnings\*(C'\fR. .PP Currently the following new features are available: \f(CW\*(C`switch\*(C'\fR (adds a switch statement), \f(CW\*(C`say\*(C'\fR (adds a \f(CW\*(C`say\*(C'\fR built-in function), and \f(CW\*(C`state\*(C'\fR (adds a \f(CW\*(C`state\*(C'\fR keyword for declaring \*(L"static\*(R" variables). Those features are described in their own sections of this document. .PP The \f(CW\*(C`feature\*(C'\fR pragma is also implicitly loaded when you require a minimal perl version (with the \f(CW\*(C`use VERSION\*(C'\fR construct) greater than, or equal to, 5.9.5. See feature for details. .SS "New \fB\-E\fP command-line switch" .IX Subsection "New -E command-line switch" \&\fB\-E\fR is equivalent to \fB\-e\fR, but it implicitly enables all optional features (like \f(CW\*(C`use feature ":5.10"\*(C'\fR). .SS "Defined-or operator" .IX Subsection "Defined-or operator" A new operator \f(CW\*(C`//\*(C'\fR (defined-or) has been implemented. The following expression: .PP .Vb 1 \& $a // $b .Ve .PP is merely equivalent to .PP .Vb 1 \& defined $a ? $a : $b .Ve .PP and the statement .PP .Vb 1 \& $c //= $d; .Ve .PP can now be used instead of .PP .Vb 1 \& $c = $d unless defined $c; .Ve .PP The \f(CW\*(C`//\*(C'\fR operator has the same precedence and associativity as \f(CW\*(C`||\*(C'\fR. Special care has been taken to ensure that this operator Do What You Mean while not breaking old code, but some edge cases involving the empty regular expression may now parse differently. See perlop for details. .SS "Switch and Smart Match operator" .IX Subsection "Switch and Smart Match operator" Perl 5 now has a switch statement. It's available when \f(CW\*(C`use feature \&\*(Aqswitch\*(Aq\*(C'\fR is in effect. This feature introduces three new keywords, \&\f(CW\*(C`given\*(C'\fR, \f(CW\*(C`when\*(C'\fR, and \f(CW\*(C`default\*(C'\fR: .PP .Vb 6 \& given ($foo) { \& when (/^abc/) { $abc = 1; } \& when (/^def/) { $def = 1; } \& when (/^xyz/) { $xyz = 1; } \& default { $nothing = 1; } \& } .Ve .PP A more complete description of how Perl matches the switch variable against the \f(CW\*(C`when\*(C'\fR conditions is given in \*(L"Switch statements\*(R" in perlsyn. .PP This kind of match is called \fIsmart match\fR, and it's also possible to use it outside of switch statements, via the new \f(CW\*(C`~~\*(C'\fR operator. See \&\*(L"Smart matching in detail\*(R" in perlsyn. .PP This feature was contributed by Robin Houston. .SS "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'\fR construct. This new way is more efficient, and in many cases easier to read. .Sp Each capturing parenthesis can now be treated as an independent pattern that 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 match nested 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 .Sp \&\s-1PCRE\s0 users should note that Perl's recursive regex feature allows backtracking into a recursed pattern, whereas in \s-1PCRE\s0 the recursion is atomic or \*(L"possessive\*(R" in nature. As in the example above, you can add (?>) to control this selectively. (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 to the 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'\fR syntax. In code, the new magical hashes \f(CW\*(C`%+\*(C'\fR and \f(CW\*(C`%\-\*(C'\fR can be used to access the contents of the capture buffers. .Sp Thus, to replace all doubled chars with a single copy, one could write .Sp .Vb 1 \& s/(?<letter>.)\ek<letter>/$+{letter}/g .Ve .Sp Only buffers with defined contents will be \*(L"visible\*(R" in the \f(CW\*(C`%+\*(C'\fR hash, so it's possible to do something like .Sp .Vb 3 \& foreach my $name (keys %+) { \& print "content of buffer \*(Aq$name\*(Aq is $+{$name}\en"; \& } .Ve .Sp The \f(CW\*(C`%\-\*(C'\fR hash is a bit more complete, since it will contain array refs holding values from all capture buffers similarly named, if there should be 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. .Sp Users exposed to the .NET regex engine will find that the perl implementation differs in that the numerical ordering of the buffers is 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 programmer would 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 never gives any back. Thus it can be used to control backtracking. The syntax is similar to non-greedy matching, except instead of using a '?' as the modifier the '+' 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 legal quantifiers. (Yves Orton) .IP "Backtracking control verbs" 4 .IX Item "Backtracking control verbs" The regex engine now supports a number of special-purpose backtrack control 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 a safer form of back-reference notation as well as allowing relative backreferences. This should make it easier to generate and embed patterns that 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 to the core. In regular expressions you can now use the special escape \f(CW\*(C`\eK\*(C'\fR as a way to do something like floating length positive lookbehind. It is also useful in substitutions like: .Sp .Vb 1 \& s/(foo)bar/$1/g .Ve .Sp that can now be converted to .Sp .Vb 1 \& s/foo\eKbar//g .Ve .Sp which 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 match vertical and horizontal whitespace, respectively. \f(CW\*(C`\eV\*(C'\fR and \f(CW\*(C`\eH\*(C'\fR logically match their complements. .Sp \&\f(CW\*(C`\eR\*(C'\fR matches a generic linebreak, that is, vertical whitespace, plus the multi-character sequence \f(CW"\ex0D\ex0A"\fR. .IP "Optional pre-match and post-match captures with the /p flag" 4 .IX Item "Optional pre-match and post-match captures with the /p flag" There is a new flag \f(CW\*(C`/p\*(C'\fR for regular expressions. Using this makes the engine preserve a copy of the part of the matched string before the matching substring to the new special variable \f(CW\*(C`${^PREMATCH}\*(C'\fR, the part after the matching substring to \f(CW\*(C`${^POSTMATCH}\*(C'\fR, and the matched substring itself to \f(CW\*(C`${^MATCH}\*(C'\fR. .Sp Perl is still able to store these substrings to the special variables \&\f(CW\*(C`$\`\*(C'\fR, \f(CW\*(C`$\*(Aq\*(C'\fR, \f(CW$&\fR, but using these variables anywhere in the program adds a penalty to all regular expression matches, whereas if you use the \f(CW\*(C`/p\*(C'\fR flag and the new special variables instead, you pay only for the regular expressions where the flag is used. .Sp For more detail on the new variables, see perlvar; for the use of the regular expression flag, see perlop and perlre. .ie n .SS """say()""" .el .SS "\f(CWsay()\fP" .IX Subsection "say()" \&\fBsay()\fR is a new built-in, only available when \f(CW\*(C`use feature \*(Aqsay\*(Aq\*(C'\fR is in effect, that is similar to \fBprint()\fR, but that implicitly appends a newline to the printed string. See \*(L"say\*(R" in perlfunc. (Robin Houston) .ie n .SS "Lexical $_" .el .SS "Lexical \f(CW$_\fP" .IX Subsection "Lexical $_" The default variable \f(CW$_\fR can now be lexicalized, by declaring it like any other lexical variable, with a simple .PP .Vb 1 \& my $_; .Ve .PP The operations that default on \f(CW$_\fR will use the lexically-scoped version of \f(CW$_\fR when it exists, instead of the global \f(CW$_\fR. .PP In a \f(CW\*(C`map\*(C'\fR or a \f(CW\*(C`grep\*(C'\fR block, if \f(CW$_\fR was previously my'ed, then the \&\f(CW$_\fR inside the block is lexical as well (and scoped to the block). .PP In a scope where \f(CW$_\fR has been lexicalized, you can still have access to the global version of \f(CW$_\fR by using \f(CW$::_\fR, or, more simply, by overriding the lexical declaration with \f(CW\*(C`our $_\*(C'\fR. (Rafael Garcia-Suarez) .ie n .SS "The ""_"" prototype" .el .SS "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 but defaults to \f(CW$_\fR if the corresponding argument isn't supplied (both \f(CW\*(C`$\*(C'\fR and \f(CW\*(C`_\*(C'\fR denote a scalar). Due to the optional nature of the argument, you can only use it at the end of a prototype, or before a semicolon. .PP This has a small incompatible consequence: the \fBprototype()\fR function has been adjusted to return \f(CW\*(C`_\*(C'\fR for some built-ins in appropriate cases (for example, \f(CW\*(C`prototype(\*(AqCORE::rmdir\*(Aq)\*(C'\fR). (Rafael Garcia-Suarez) .SS "\s-1UNITCHECK\s0 blocks" .IX Subsection "UNITCHECK blocks" \&\f(CW\*(C`UNITCHECK\*(C'\fR, a new special code block has been introduced, in addition to \&\f(CW\*(C`BEGIN\*(C'\fR, \f(CW\*(C`CHECK\*(C'\fR, \f(CW\*(C`INIT\*(C'\fR and \f(CW\*(C`END\*(C'\fR. .PP \&\f(CW\*(C`CHECK\*(C'\fR and \f(CW\*(C`INIT\*(C'\fR blocks, while useful for some specialized purposes, are always executed at the transition between the compilation and the execution of the main program, and thus are useless whenever code is loaded at runtime. On the other hand, \f(CW\*(C`UNITCHECK\*(C'\fR blocks are executed just after the unit which defined them has been compiled. See perlmod for more information. (Alex Gough) .ie n .SS "New Pragma, ""mro""" .el .SS "New Pragma, \f(CWmro\fP" .IX Subsection "New Pragma, mro" A new pragma, \f(CW\*(C`mro\*(C'\fR (for Method Resolution Order) has been added. It permits to switch, on a per-class basis, the algorithm that perl uses to find inherited methods in case of a multiple inheritance hierarchy. The default \s-1MRO\s0 hasn't changed (\s-1DFS,\s0 for Depth First Search). Another \s-1MRO\s0 is available: the C3 algorithm. See mro for more information. (Brandon Black) .PP Note that, due to changes in the implementation of class hierarchy search, code that used to undef the \f(CW*ISA\fR glob will most probably break. Anyway, undef'ing \f(CW*ISA\fR had the side-effect of removing the magic on the \f(CW@ISA\fR array and should not have been done in the first place. Also, the cache \f(CW*::ISA::CACHE::\fR no longer exists; to force reset the \f(CW@ISA\fR cache, you now need to use the \f(CW\*(C`mro\*(C'\fR \s-1API,\s0 or more simply to assign to \f(CW@ISA\fR (e.g. with \f(CW\*(C`@ISA = @ISA\*(C'\fR). .ie n .SS "\fBreaddir()\fP may return a ""short filename"" on Windows" .el .SS "\fBreaddir()\fP may return a ``short filename'' on Windows" .IX Subsection "readdir() may return a short filename on Windows" The \fBreaddir()\fR function may return a \*(L"short filename\*(R" when the long filename contains characters outside the \s-1ANSI\s0 codepage. Similarly \&\fBCwd::cwd()\fR may return a short directory name, and \fBglob()\fR may return short names as well. On the \s-1NTFS\s0 file system these short names can always be represented in the \s-1ANSI\s0 codepage. This will not be true for all other file system drivers; e.g. the \s-1FAT\s0 filesystem stores short filenames in the \s-1OEM\s0 codepage, so some files on \s-1FAT\s0 volumes remain unaccessible through the \&\s-1ANSI\s0 APIs. .PP Similarly, $^X, \f(CW@INC\fR, and \f(CW$ENV\fR{\s-1PATH\s0} are preprocessed at startup to make sure all paths are valid in the \s-1ANSI\s0 codepage (if possible). .PP The \fBWin32::GetLongPathName()\fR function now returns the \s-1UTF\-8\s0 encoded correct long file name instead of using replacement characters to force the name into the \s-1ANSI\s0 codepage. The new \fBWin32::GetANSIPathName()\fR function can be used to turn a long pathname into a short one only if the long one cannot be represented in the \s-1ANSI\s0 codepage. .PP Many other functions in the \f(CW\*(C`Win32\*(C'\fR module have been improved to accept \&\s-1UTF\-8\s0 encoded arguments. Please see Win32 for details. .SS "\fBreadpipe()\fP is now overridable" .IX Subsection "readpipe() is now overridable" The built-in function \fBreadpipe()\fR is now overridable. Overriding it permits also to override its operator counterpart, \f(CW\*(C`qx//\*(C'\fR (a.k.a. \f(CW\*(C`\`\`\*(C'\fR). Moreover, it now defaults to \f(CW$_\fR if no argument is provided. (Rafael Garcia-Suarez) .SS "Default argument for \fBreadline()\fP" .IX Subsection "Default argument for readline()" \&\fBreadline()\fR now defaults to \f(CW*ARGV\fR if no argument is provided. (Rafael Garcia-Suarez) .SS "\fBstate()\fP variables" .IX Subsection "state() variables" A new class of variables has been introduced. State variables are similar to \f(CW\*(C`my\*(C'\fR variables, but are declared with the \f(CW\*(C`state\*(C'\fR keyword in place of \&\f(CW\*(C`my\*(C'\fR. They're visible only in their lexical scope, but their value is persistent: unlike \f(CW\*(C`my\*(C'\fR variables, they're not undefined at scope entry, but retain their previous value. (Rafael Garcia-Suarez, Nicholas Clark) .PP To use state variables, one needs to enable them by using .PP .Vb 1 \& use feature \*(Aqstate\*(Aq; .Ve .PP or by using the \f(CW\*(C`\-E\*(C'\fR command-line switch in one-liners. See \*(L"Persistent Private Variables\*(R" in perlsub. .SS "Stacked filetest operators" .IX Subsection "Stacked filetest operators" As a new form of syntactic sugar, it's now possible to stack up filetest operators. You can now write \f(CW\*(C`\-f \-w \-x $file\*(C'\fR in a row to mean \&\f(CW\*(C`\-x $file && \-w _ && \-f _\*(C'\fR. See \*(L"\-X\*(R" in perlfunc. .SS "\s-1\fBUNIVERSAL::DOES\s0()\fP" .IX Subsection "UNIVERSAL::DOES()" The \f(CW\*(C`UNIVERSAL\*(C'\fR class has a new method, \f(CW\*(C`DOES()\*(C'\fR. It has been added to solve semantic problems with the \f(CW\*(C`isa()\*(C'\fR method. \f(CW\*(C`isa()\*(C'\fR checks for inheritance, while \f(CW\*(C`DOES()\*(C'\fR has been designed to be overridden when module authors use other types of relations between classes (in addition to inheritance). (chromatic) .PP See \*(L"$obj\->\s-1DOES\s0( \s-1ROLE\s0 )\*(R" in \s-1UNIVERSAL\s0. .SS "Formats" .IX Subsection "Formats" Formats were improved in several ways. A new field, \f(CW\*(C`^*\*(C'\fR, can be used for variable-width, one-line-at-a-time text. Null characters are now handled correctly in picture lines. Using \f(CW\*(C`@#\*(C'\fR and \f(CW\*(C`~~\*(C'\fR together will now produce a compile-time error, as those format fields are incompatible. perlform has been improved, and miscellaneous bugs fixed. .SS "Byte-order modifiers for \fBpack()\fP and \fBunpack()\fP" .IX Subsection "Byte-order modifiers for pack() and unpack()" There are two new byte-order modifiers, \f(CW\*(C`>\*(C'\fR (big-endian) and \f(CW\*(C`<\*(C'\fR (little-endian), that can be appended to most \fBpack()\fR and \fBunpack()\fR template characters and groups to force a certain byte-order for that type or group. See \*(L"pack\*(R" in perlfunc and perlpacktut for details. .ie n .SS """no VERSION""" .el .SS "\f(CWno VERSION\fP" .IX Subsection "no VERSION" You can now use \f(CW\*(C`no\*(C'\fR followed by a version number to specify that you want to use a version of perl older than the specified one. .ie n .SS """chdir"", ""chmod"" and ""chown"" on filehandles" .el .SS "\f(CWchdir\fP, \f(CWchmod\fP and \f(CWchown\fP on filehandles" .IX Subsection "chdir, chmod and chown on filehandles" \&\f(CW\*(C`chdir\*(C'\fR, \f(CW\*(C`chmod\*(C'\fR and \f(CW\*(C`chown\*(C'\fR can now work on filehandles as well as filenames, if the system supports respectively \f(CW\*(C`fchdir\*(C'\fR, \f(CW\*(C`fchmod\*(C'\fR and \&\f(CW\*(C`fchown\*(C'\fR, thanks to a patch provided by Gisle Aas. .SS "\s-1OS\s0 groups" .IX Subsection "OS groups" \&\f(CW$(\fR and \f(CW$)\fR now return groups in the order where the \s-1OS\s0 returns them, thanks to Gisle Aas. This wasn't previously the case. .SS "Recursive sort subs" .IX Subsection "Recursive sort subs" You can now use recursive subroutines with \fBsort()\fR, thanks to Robin Houston. .SS "Exceptions in constant folding" .IX Subsection "Exceptions in constant folding" The constant folding routine is now wrapped in an exception handler, and if folding throws an exception (such as attempting to evaluate 0/0), perl now retains the current optree, rather than aborting the whole program. Without this change, programs would not compile if they had expressions that happened to generate exceptions, even though those expressions were in code that could never be reached at runtime. (Nicholas Clark, Dave Mitchell) .ie n .SS "Source filters in @INC" .el .SS "Source filters in \f(CW@INC\fP" .IX Subsection "Source filters in @INC" It's possible to enhance the mechanism of subroutine hooks in \f(CW@INC\fR by adding a source filter on top of the filehandle opened and returned by the hook. This feature was planned a long time ago, but wasn't quite working until now. See \*(L"require\*(R" in perlfunc for details. (Nicholas Clark) .SS "New internal variables" .IX Subsection "New internal variables" .ie n .IP """${^RE_DEBUG_FLAGS}""" 4 .el .IP "\f(CW${^RE_DEBUG_FLAGS}\fR" 4 .IX Item "${^RE_DEBUG_FLAGS}" This variable controls what debug flags are in effect for the regular expression engine when running under \f(CW\*(C`use re "debug"\*(C'\fR. See re for details. .ie n .IP """${^CHILD_ERROR_NATIVE}""" 4 .el .IP "\f(CW${^CHILD_ERROR_NATIVE}\fR" 4 .IX Item "${^CHILD_ERROR_NATIVE}" This variable gives the native status returned by the last pipe close, backtick command, successful call to \fBwait()\fR or \fBwaitpid()\fR, or from the \&\fBsystem()\fR operator. See perlvar for details. (Contributed by Gisle Aas.) .ie n .IP """${^RE_TRIE_MAXBUF}""" 4 .el .IP "\f(CW${^RE_TRIE_MAXBUF}\fR" 4 .IX Item "${^RE_TRIE_MAXBUF}" See \*(L"Trie optimisation of literal string alternations\*(R". .ie n .IP """${^WIN32_SLOPPY_STAT}""" 4 .el .IP "\f(CW${^WIN32_SLOPPY_STAT}\fR" 4 .IX Item "${^WIN32_SLOPPY_STAT}" See \*(L"Sloppy stat on Windows\*(R". .SS "Miscellaneous" .IX Subsection "Miscellaneous" \&\f(CW\*(C`unpack()\*(C'\fR now defaults to unpacking the \f(CW$_\fR variable. .PP \&\f(CW\*(C`mkdir()\*(C'\fR without arguments now defaults to \f(CW$_\fR. .PP The internal dump output has been improved, so that non-printable characters such as newline and backspace are output in \f(CW\*(C`\ex\*(C'\fR notation, rather than octal. .PP The \fB\-C\fR option can no longer be used on the \f(CW\*(C`#!\*(C'\fR line. It wasn't working there anyway, since the standard streams are already set up at this point in the execution of the perl interpreter. You can use \&\fBbinmode()\fR instead to get the desired behaviour. .SS "\s-1UCD 5.0.0\s0" .IX Subsection "UCD 5.0.0" The copy of the Unicode Character Database included in Perl 5 has been updated to version 5.0.0. .SS "\s-1MAD\s0" .IX Subsection "MAD" \&\s-1MAD,\s0 which stands for \fIMiscellaneous Attribute Decoration\fR, is a still-in-development work leading to a Perl 5 to Perl 6 converter. To enable it, it's necessary to pass the argument \f(CW\*(C`\-Dmad\*(C'\fR to Configure. The obtained perl isn't binary compatible with a regular perl 5.10, and has space and speed penalties; moreover not all regression tests still pass with it. (Larry Wall, Nicholas Clark) .SS "\fBkill()\fP on Windows" .IX Subsection "kill() on Windows" On Windows platforms, \f(CW\*(C`kill(\-9, $pid)\*(C'\fR now kills a process tree. (On Unix, this delivers the signal to all processes in the same process group.) .SH "Incompatible Changes" .IX Header "Incompatible Changes" .SS "Packing and \s-1UTF\-8\s0 strings" .IX Subsection "Packing and UTF-8 strings" The semantics of \fBpack()\fR and \fBunpack()\fR regarding UTF\-8\-encoded data has been changed. Processing is now by default character per character instead of byte per byte on the underlying encoding. Notably, code that used things like \f(CW\*(C`pack("a*", $string)\*(C'\fR to see through the encoding of string will now simply get back the original \f(CW$string\fR. Packed strings can also get upgraded during processing when you store upgraded characters. You can get the old behaviour by using \f(CW\*(C`use bytes\*(C'\fR. .PP To be consistent with \fBpack()\fR, the \f(CW\*(C`C0\*(C'\fR in \fBunpack()\fR templates indicates that the data is to be processed in character mode, i.e. character by character; on the contrary, \f(CW\*(C`U0\*(C'\fR in \fBunpack()\fR indicates \s-1UTF\-8\s0 mode, where the packed string is processed in its UTF\-8\-encoded Unicode form on a byte by byte basis. This is reversed with regard to perl 5.8.X, but now consistent between \fBpack()\fR and \fBunpack()\fR. .PP Moreover, \f(CW\*(C`C0\*(C'\fR and \f(CW\*(C`U0\*(C'\fR can also be used in \fBpack()\fR templates to specify respectively character and byte modes. .PP \&\f(CW\*(C`C0\*(C'\fR and \f(CW\*(C`U0\*(C'\fR in the middle of a pack or unpack format now switch to the specified encoding mode, honoring parens grouping. Previously, parens were ignored. .PP Also, there is a new \fBpack()\fR character format, \f(CW\*(C`W\*(C'\fR, which is intended to replace the old \f(CW\*(C`C\*(C'\fR. \f(CW\*(C`C\*(C'\fR is kept for unsigned chars coded as bytes in the strings internal representation. \f(CW\*(C`W\*(C'\fR represents unsigned (logical) character values, which can be greater than 255. It is therefore more robust when dealing with potentially UTF\-8\-encoded data (as \f(CW\*(C`C\*(C'\fR will wrap values outside the range 0..255, and not respect the string encoding). .PP In practice, that means that pack formats are now encoding-neutral, except \&\f(CW\*(C`C\*(C'\fR. .PP For consistency, \f(CW\*(C`A\*(C'\fR in \fBunpack()\fR format now trims all Unicode whitespace from the end of the string. Before perl 5.9.2, it used to strip only the classical \s-1ASCII\s0 space characters. .SS "Byte/character count feature in \fBunpack()\fP" .IX Subsection "Byte/character count feature in unpack()" A new \fBunpack()\fR template character, \f(CW"."\fR, returns the number of bytes or characters (depending on the selected encoding mode, see above) read so far. .ie n .SS "The $* and $# variables have been removed" .el .SS "The \f(CW$*\fP and \f(CW$#\fP variables have been removed" .IX Subsection "The $* and $# variables have been removed" \&\f(CW$*\fR, which was deprecated in favor of the \f(CW\*(C`/s\*(C'\fR and \f(CW\*(C`/m\*(C'\fR regexp modifiers, has been removed. .PP The deprecated \f(CW$#\fR variable (output format for numbers) has been removed. .PP Two new severe warnings, \f(CW\*(C`$#/$* is no longer supported\*(C'\fR, have been added. .SS "\fBsubstr()\fP lvalues are no longer fixed-length" .IX Subsection "substr() lvalues are no longer fixed-length" The lvalues returned by the three argument form of \fBsubstr()\fR used to be a \&\*(L"fixed length window\*(R" on the original string. In some cases this could cause surprising action at distance or other undefined behaviour. Now the length of the window adjusts itself to the length of the string assigned to it. .ie n .SS "Parsing of ""\-f _""" .el .SS "Parsing of \f(CW\-f _\fP" .IX Subsection "Parsing of -f _" The identifier \f(CW\*(C`_\*(C'\fR is now forced to be a bareword after a filetest operator. This solves a number of misparsing issues when a global \f(CW\*(C`_\*(C'\fR subroutine is defined. .ie n .SS """:unique""" .el .SS "\f(CW:unique\fP" .IX Subsection ":unique" The \f(CW\*(C`:unique\*(C'\fR attribute has been made a no-op, since its current implementation was fundamentally flawed and not threadsafe. .SS "Effect of pragmas in eval" .IX Subsection "Effect of pragmas in eval" The compile-time value of the \f(CW\*(C`%^H\*(C'\fR hint variable can now propagate into eval("")uated code. This makes it more useful to implement lexical pragmas. .PP As a side-effect of this, the overloaded-ness of constants now propagates into eval(""). .SS "chdir \s-1FOO\s0" .IX Subsection "chdir FOO" A bareword argument to \fBchdir()\fR is now recognized as a file handle. Earlier releases interpreted the bareword as a directory name. (Gisle Aas) .SS "Handling of .pmc files" .IX Subsection "Handling of .pmc files" An old feature of perl was that before \f(CW\*(C`require\*(C'\fR or \f(CW\*(C`use\*(C'\fR look for a file with a \fI.pm\fR extension, they will first look for a similar filename with a \fI.pmc\fR extension. If this file is found, it will be loaded in place of any potentially existing file ending in a \fI.pm\fR extension. .PP Previously, \fI.pmc\fR files were loaded only if more recent than the matching \fI.pm\fR file. Starting with 5.9.4, they'll be always loaded if they exist. .ie n .SS "$^V is now a ""version"" object instead of a v\-string" .el .SS "$^V is now a \f(CWversion\fP object instead of a v\-string" .IX Subsection "$^V is now a version object instead of a v-string" $^V can still be used with the \f(CW%vd\fR format in printf, but any character-level operations will now access the string representation of the \f(CW\*(C`version\*(C'\fR object and not the ordinals of a v\-string. Expressions like \f(CW\*(C`substr($^V, 0, 2)\*(C'\fR or \f(CW\*(C`split //, $^V\*(C'\fR no longer work and must be rewritten. .SS "@\- and @+ in patterns" .IX Subsection "@- and @+ in patterns" The special arrays \f(CW\*(C`@\-\*(C'\fR and \f(CW\*(C`@+\*(C'\fR are no longer interpolated in regular expressions. (Sadahiro Tomoyuki) .ie n .SS "$AUTOLOAD can now be tainted" .el .SS "\f(CW$AUTOLOAD\fP can now be tainted" .IX Subsection "$AUTOLOAD can now be tainted" If you call a subroutine by a tainted name, and if it defers to an \&\s-1AUTOLOAD\s0 function, then \f(CW$AUTOLOAD\fR will be (correctly) tainted. (Rick Delaney) .SS "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 now reject any tainted format argument. (Rafael Garcia-Suarez) .SS "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 now equivalent to setting it to \f(CW\*(AqDEFAULT\*(Aq\fR. (Rafael Garcia-Suarez) .SS "strictures and dereferencing in \fBdefined()\fP" .IX Subsection "strictures and dereferencing in defined()" \&\f(CW\*(C`use strict \*(Aqrefs\*(Aq\*(C'\fR was ignoring taking a hard reference in an argument to \fBdefined()\fR, as in : .PP .Vb 3 \& use strict \*(Aqrefs\*(Aq; \& my $x = \*(Aqfoo\*(Aq; \& if (defined $$x) {...} .Ve .PP This now correctly produces the run-time error \f(CW\*(C`Can\*(Aqt use string as a SCALAR ref while "strict refs" in use\*(C'\fR. .PP \&\f(CW\*(C`defined @$foo\*(C'\fR and \f(CW\*(C`defined %$bar\*(C'\fR are now also 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.) (\f(CW\*(C`defined(@foo)\*(C'\fR and \f(CW\*(C`defined(%bar)\*(C'\fR are discouraged constructs anyway.) (Nicholas Clark) .ie n .SS """(?p{})"" has been removed" .el .SS "\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 perl 5.8, has been removed. Use \f(CW\*(C`(??{})\*(C'\fR instead. (Rafael Garcia-Suarez) .SS "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'\fR pragma remains here, but uses an alternate implementation.) .SS "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. Those experimental tools have never worked reliably, and, due to the lack of volunteers to keep them in line with the perl interpreter developments, it was 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. .PP However the B compiler framework stays supported in the perl core, as with the more useful modules it has permitted (among others, B::Deparse and B::Concise). .SS "Removal of the \s-1JPL\s0" .IX Subsection "Removal of the JPL" The \s-1JPL\s0 (Java-Perl Lingo) has been removed from the perl sources tarball. .SS "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. .PP Previously, the exception would not occur until Perl attempted to make use of the recursive inheritance while resolving a method or doing a \&\f(CW\*(C`$foo\->isa($bar)\*(C'\fR lookup. .SS "warnings::enabled and warnings::warnif changed to favor users of modules" .IX Subsection "warnings::enabled and warnings::warnif changed to favor users of modules" The behaviour in 5.10.x favors the person using the module; The behaviour in 5.8.x favors the module writer; .PP Assume the following code: .PP .Vb 5 \& main calls Foo::Bar::baz() \& Foo::Bar inherits from Foo::Base \& Foo::Bar::baz() calls Foo::Base::_bazbaz() \& Foo::Base::_bazbaz() calls: warnings::warnif(\*(Aqsubstr\*(Aq, \*(Aqsome warning \&message\*(Aq); .Ve .PP On 5.8.x, the code warns when Foo::Bar contains \f(CW\*(C`use warnings;\*(C'\fR It does not matter if Foo::Base or main have warnings enabled to disable the warning one has to modify Foo::Bar. .PP On 5.10.0 and newer, the code warns when main contains \f(CW\*(C`use warnings;\*(C'\fR It does not matter if Foo::Base or Foo::Bar have warnings enabled to disable the warning one has to modify main. .SH "Modules and Pragmata" .IX Header "Modules and Pragmata" .SS "Upgrading individual core modules" .IX Subsection "Upgrading individual core modules" Even more core modules are now also available separately through the \&\s-1CPAN.\s0 If you wish to update one of these modules, you don't need to wait for a new perl release. From within the cpan shell, running the \&'r' command will report on modules with upgrades available. See \&\f(CW\*(C`perldoc CPAN\*(C'\fR for more information. .SS "Pragmata Changes" .IX Subsection "Pragmata Changes" .ie n .IP """feature""" 4 .el .IP "\f(CWfeature\fR" 4 .IX Item "feature" The new pragma \f(CW\*(C`feature\*(C'\fR is used to enable new features that might break old code. See "The \f(CW\*(C`feature\*(C'\fR pragma" above. .ie n .IP """mro""" 4 .el .IP "\f(CWmro\fR" 4 .IX Item "mro" This new pragma enables to change the algorithm used to resolve inherited methods. See "New Pragma, \f(CW\*(C`mro\*(C'\fR" above. .ie n .IP "Scoping of the ""sort"" pragma" 4 .el .IP "Scoping of the \f(CWsort\fR pragma" 4 .IX Item "Scoping of the sort pragma" The \f(CW\*(C`sort\*(C'\fR pragma is now lexically scoped. Its effect used to be global. .ie n .IP "Scoping of ""bignum"", ""bigint"", ""bigrat""" 4 .el .IP "Scoping of \f(CWbignum\fR, \f(CWbigint\fR, \f(CWbigrat\fR" 4 .IX Item "Scoping of bignum, bigint, bigrat" The three numeric pragmas \f(CW\*(C`bignum\*(C'\fR, \f(CW\*(C`bigint\*(C'\fR and \f(CW\*(C`bigrat\*(C'\fR are now lexically scoped. (Tels) .ie n .IP """base""" 4 .el .IP "\f(CWbase\fR" 4 .IX Item "base" The \f(CW\*(C`base\*(C'\fR pragma now warns if a class tries to inherit from itself. (Curtis \*(L"Ovid\*(R" Poe) .ie n .IP """strict"" and ""warnings""" 4 .el .IP "\f(CWstrict\fR and \f(CWwarnings\fR" 4 .IX Item "strict and warnings" \&\f(CW\*(C`strict\*(C'\fR and \f(CW\*(C`warnings\*(C'\fR will now complain loudly if they are loaded via incorrect casing (as in \f(CW\*(C`use Strict;\*(C'\fR). (Johan Vromans) .ie n .IP """version""" 4 .el .IP "\f(CWversion\fR" 4 .IX Item "version" The \f(CW\*(C`version\*(C'\fR module provides support for version objects. .ie n .IP """warnings""" 4 .el .IP "\f(CWwarnings\fR" 4 .IX Item "warnings" The \f(CW\*(C`warnings\*(C'\fR pragma doesn't load \f(CW\*(C`Carp\*(C'\fR anymore. That means that code that used \f(CW\*(C`Carp\*(C'\fR routines without having loaded it at compile time might need to be adjusted; typically, the following (faulty) code won't work anymore, and will require parentheses to be added after the function name: .Sp .Vb 3 \& use warnings; \& require Carp; \& Carp::confess \*(Aqargh\*(Aq; .Ve .ie n .IP """less""" 4 .el .IP "\f(CWless\fR" 4 .IX Item "less" \&\f(CW\*(C`less\*(C'\fR now does something useful (or at least it tries to). In fact, it has been turned into a lexical pragma. So, in your modules, you can now test whether your users have requested to use less \s-1CPU,\s0 or less memory, less magic, or maybe even less fat. See less for more. (Joshua ben Jore) .SS "New modules" .IX Subsection "New modules" .IP "\(bu" 4 \&\f(CW\*(C`encoding::warnings\*(C'\fR, by Audrey Tang, is a module to emit warnings whenever an \s-1ASCII\s0 character string containing high-bit bytes is implicitly converted into \s-1UTF\-8.\s0 It's a lexical pragma since Perl 5.9.4; on older perls, its effect is global. .IP "\(bu" 4 \&\f(CW\*(C`Module::CoreList\*(C'\fR, by Richard Clamp, is a small handy module that tells you what versions of core modules ship with any versions of Perl 5. It comes with a command-line frontend, \f(CW\*(C`corelist\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`Math::BigInt::FastCalc\*(C'\fR is an XS-enabled, and thus faster, version of \&\f(CW\*(C`Math::BigInt::Calc\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`Compress::Zlib\*(C'\fR is an interface to the zlib compression library. It comes with a bundled version of zlib, so having a working zlib is not a prerequisite to install it. It's used by \f(CW\*(C`Archive::Tar\*(C'\fR (see below). .IP "\(bu" 4 \&\f(CW\*(C`IO::Zlib\*(C'\fR is an \f(CW\*(C`IO::\*(C'\fR\-style interface to \f(CW\*(C`Compress::Zlib\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`Archive::Tar\*(C'\fR is a module to manipulate \f(CW\*(C`tar\*(C'\fR archives. .IP "\(bu" 4 \&\f(CW\*(C`Digest::SHA\*(C'\fR is a module used to calculate many types of \s-1SHA\s0 digests, has been included for \s-1SHA\s0 support in the \s-1CPAN\s0 module. .IP "\(bu" 4 \&\f(CW\*(C`ExtUtils::CBuilder\*(C'\fR and \f(CW\*(C`ExtUtils::ParseXS\*(C'\fR have been added. .IP "\(bu" 4 \&\f(CW\*(C`Hash::Util::FieldHash\*(C'\fR, by Anno Siegel, has been added. This module provides support for \fIfield hashes\fR: hashes that maintain an association of a reference with a value, in a thread-safe garbage-collected way. Such hashes are useful to implement inside-out objects. .IP "\(bu" 4 \&\f(CW\*(C`Module::Build\*(C'\fR, by Ken Williams, has been added. It's an alternative to \&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR to build and install perl modules. .IP "\(bu" 4 \&\f(CW\*(C`Module::Load\*(C'\fR, by Jos Boumans, has been added. It provides a single interface to load Perl modules and \fI.pl\fR files. .IP "\(bu" 4 \&\f(CW\*(C`Module::Loaded\*(C'\fR, by Jos Boumans, has been added. It's used to mark modules as loaded or unloaded. .IP "\(bu" 4 \&\f(CW\*(C`Package::Constants\*(C'\fR, by Jos Boumans, has been added. It's a simple helper to list all constants declared in a given package. .IP "\(bu" 4 \&\f(CW\*(C`Win32API::File\*(C'\fR, by Tye McQueen, has been added (for Windows builds). This module provides low-level access to Win32 system \s-1API\s0 calls for files/dirs. .IP "\(bu" 4 \&\f(CW\*(C`Locale::Maketext::Simple\*(C'\fR, needed by \s-1CPANPLUS,\s0 is a simple wrapper around \&\f(CW\*(C`Locale::Maketext::Lexicon\*(C'\fR. Note that \f(CW\*(C`Locale::Maketext::Lexicon\*(C'\fR isn't included in the perl core; the behaviour of \f(CW\*(C`Locale::Maketext::Simple\*(C'\fR gracefully degrades when the later isn't present. .IP "\(bu" 4 \&\f(CW\*(C`Params::Check\*(C'\fR implements a generic input parsing/checking mechanism. It is used by \s-1CPANPLUS.\s0 .IP "\(bu" 4 \&\f(CW\*(C`Term::UI\*(C'\fR simplifies the task to ask questions at a terminal prompt. .IP "\(bu" 4 \&\f(CW\*(C`Object::Accessor\*(C'\fR provides an interface to create per-object accessors. .IP "\(bu" 4 \&\f(CW\*(C`Module::Pluggable\*(C'\fR is a simple framework to create modules that accept pluggable sub-modules. .IP "\(bu" 4 \&\f(CW\*(C`Module::Load::Conditional\*(C'\fR provides simple ways to query and possibly load installed modules. .IP "\(bu" 4 \&\f(CW\*(C`Time::Piece\*(C'\fR provides an object oriented interface to time functions, overriding the built-ins \fBlocaltime()\fR and \fBgmtime()\fR. .IP "\(bu" 4 \&\f(CW\*(C`IPC::Cmd\*(C'\fR helps to find and run external commands, possibly interactively. .IP "\(bu" 4 \&\f(CW\*(C`File::Fetch\*(C'\fR provide a simple generic file fetching mechanism. .IP "\(bu" 4 \&\f(CW\*(C`Log::Message\*(C'\fR and \f(CW\*(C`Log::Message::Simple\*(C'\fR are used by the log facility of \f(CW\*(C`CPANPLUS\*(C'\fR. .IP "\(bu" 4 \&\f(CW\*(C`Archive::Extract\*(C'\fR is a generic archive extraction mechanism for \fI.tar\fR (plain, gzipped or bzipped) or \fI.zip\fR files. .IP "\(bu" 4 \&\f(CW\*(C`CPANPLUS\*(C'\fR provides an \s-1API\s0 and a command-line tool to access the \s-1CPAN\s0 mirrors. .IP "\(bu" 4 \&\f(CW\*(C`Pod::Escapes\*(C'\fR provides utilities that are useful in decoding Pod E<...> sequences. .IP "\(bu" 4 \&\f(CW\*(C`Pod::Simple\*(C'\fR is now the backend for several of the Pod-related modules included with Perl. .SS "Selected Changes to Core Modules" .IX Subsection "Selected Changes to Core Modules" .ie n .IP """Attribute::Handlers""" 4 .el .IP "\f(CWAttribute::Handlers\fR" 4 .IX Item "Attribute::Handlers" \&\f(CW\*(C`Attribute::Handlers\*(C'\fR can now report the caller's file and line number. (David Feldman) .Sp All interpreted attributes are now passed as array references. (Damian Conway) .ie n .IP """B::Lint""" 4 .el .IP "\f(CWB::Lint\fR" 4 .IX Item "B::Lint" \&\f(CW\*(C`B::Lint\*(C'\fR is now based on \f(CW\*(C`Module::Pluggable\*(C'\fR, and so can be extended with plugins. (Joshua ben Jore) .ie n .IP """B""" 4 .el .IP "\f(CWB\fR" 4 .IX Item "B" It's now possible to access the lexical pragma hints (\f(CW\*(C`%^H\*(C'\fR) by using the method \fBB::COP::hints_hash()\fR. It returns a \f(CW\*(C`B::RHE\*(C'\fR object, which in turn can be used to get a hash reference via the method \fBB::RHE::HASH()\fR. (Joshua ben Jore) .ie n .IP """Thread""" 4 .el .IP "\f(CWThread\fR" 4 .IX Item "Thread" As the old 5005thread threading model has been removed, in favor of the ithreads scheme, the \f(CW\*(C`Thread\*(C'\fR module is now a compatibility wrapper, to be used in old code only. It has been removed from the default list of dynamic extensions. .SH "Utility Changes" .IX Header "Utility Changes" .IP "perl \-d" 4 .IX Item "perl -d" The Perl debugger can now save all debugger commands for sourcing later; notably, it can now emulate stepping backwards, by restarting and rerunning all bar the last command from a saved command history. .Sp It can also display the parent inheritance tree of a given class, with the \&\f(CW\*(C`i\*(C'\fR command. .IP "ptar" 4 .IX Item "ptar" \&\f(CW\*(C`ptar\*(C'\fR is a pure perl implementation of \f(CW\*(C`tar\*(C'\fR that comes with \&\f(CW\*(C`Archive::Tar\*(C'\fR. .IP "ptardiff" 4 .IX Item "ptardiff" \&\f(CW\*(C`ptardiff\*(C'\fR is a small utility used to generate a diff between the contents of a tar archive and a directory tree. Like \f(CW\*(C`ptar\*(C'\fR, it comes with \&\f(CW\*(C`Archive::Tar\*(C'\fR. .IP "shasum" 4 .IX Item "shasum" \&\f(CW\*(C`shasum\*(C'\fR is a command-line utility, used to print or to check \s-1SHA\s0 digests. It comes with the new \f(CW\*(C`Digest::SHA\*(C'\fR module. .IP "corelist" 4 .IX Item "corelist" The \f(CW\*(C`corelist\*(C'\fR utility is now installed with perl (see \*(L"New modules\*(R" above). .IP "h2ph and h2xs" 4 .IX Item "h2ph and h2xs" \&\f(CW\*(C`h2ph\*(C'\fR and \f(CW\*(C`h2xs\*(C'\fR have been made more robust with regard to \&\*(L"modern\*(R" C code. .Sp \&\f(CW\*(C`h2xs\*(C'\fR implements a new option \f(CW\*(C`\-\-use\-xsloader\*(C'\fR to force use of \&\f(CW\*(C`XSLoader\*(C'\fR even in backwards compatible modules. .Sp The handling of authors' names that had apostrophes has been fixed. .Sp Any enums with negative values are now skipped. .IP "perlivp" 4 .IX Item "perlivp" \&\f(CW\*(C`perlivp\*(C'\fR no longer checks for \fI*.ph\fR files by default. Use the new \f(CW\*(C`\-a\*(C'\fR option to run \fIall\fR tests. .IP "find2perl" 4 .IX Item "find2perl" \&\f(CW\*(C`find2perl\*(C'\fR now assumes \f(CW\*(C`\-print\*(C'\fR as a default action. Previously, it needed to be specified explicitly. .Sp Several bugs have been fixed in \f(CW\*(C`find2perl\*(C'\fR, regarding \f(CW\*(C`\-exec\*(C'\fR and \&\f(CW\*(C`\-eval\*(C'\fR. Also the options \f(CW\*(C`\-path\*(C'\fR, \f(CW\*(C`\-ipath\*(C'\fR and \f(CW\*(C`\-iname\*(C'\fR have been added. .IP "config_data" 4 .IX Item "config_data" \&\f(CW\*(C`config_data\*(C'\fR is a new utility that comes with \f(CW\*(C`Module::Build\*(C'\fR. It provides a command-line interface to the configuration of Perl modules that use Module::Build's framework of configurability (that is, \&\f(CW*::ConfigData\fR modules that contain local configuration information for their parent modules.) .IP "cpanp" 4 .IX Item "cpanp" \&\f(CW\*(C`cpanp\*(C'\fR, the \s-1CPANPLUS\s0 shell, has been added. (\f(CW\*(C`cpanp\-run\-perl\*(C'\fR, a helper for \s-1CPANPLUS\s0 operation, has been added too, but isn't intended for direct use). .IP "cpan2dist" 4 .IX Item "cpan2dist" \&\f(CW\*(C`cpan2dist\*(C'\fR is a new utility that comes with \s-1CPANPLUS.\s0 It's a tool to create distributions (or packages) from \s-1CPAN\s0 modules. .IP "pod2html" 4 .IX Item "pod2html" The output of \f(CW\*(C`pod2html\*(C'\fR has been enhanced to be more customizable via \&\s-1CSS.\s0 Some formatting problems were also corrected. (Jari Aalto) .SH "New Documentation" .IX Header "New Documentation" The perlpragma manpage documents how to write one's own lexical pragmas in pure Perl (something that is possible starting with 5.9.4). .PP The new perlglossary manpage is a glossary of terms used in the Perl documentation, technical and otherwise, kindly provided by O'Reilly Media, Inc. .PP The perlreguts manpage, courtesy of Yves Orton, describes internals of the Perl regular expression engine. .PP The perlreapi manpage describes the interface to the perl interpreter used to write pluggable regular expression engines (by \*(Aevar Arnfjo\*:r\*(d- Bjarmason). .PP The perlunitut manpage is a tutorial for programming with Unicode and string encodings in Perl, courtesy of Juerd Waalboer. .PP A new manual page, perlunifaq (the Perl Unicode \s-1FAQ\s0), has been added (Juerd Waalboer). .PP The perlcommunity manpage gives a description of the Perl community on the Internet and in real life. (Edgar \*(L"Trizor\*(R" Bering) .PP The \s-1CORE\s0 manual page documents the \f(CW\*(C`CORE::\*(C'\fR namespace. (Tels) .PP The long-existing feature of \f(CW\*(C`/(?{...})/\*(C'\fR regexps setting \f(CW$_\fR and \fBpos()\fR is now documented. .SH "Performance Enhancements" .IX Header "Performance Enhancements" .SS "In-place sorting" .IX Subsection "In-place sorting" Sorting arrays in place (\f(CW\*(C`@a = sort @a\*(C'\fR) is now optimized to avoid making a temporary copy of the array. .PP Likewise, \f(CW\*(C`reverse sort ...\*(C'\fR is now optimized to sort in reverse, avoiding the generation of a temporary intermediate list. .SS "Lexical array access" .IX Subsection "Lexical array access" Access to elements of lexical arrays via a numeric constant between 0 and 255 is now faster. (This used to be only the case for global arrays.) .SS "XS-assisted \s-1SWASHGET\s0" .IX Subsection "XS-assisted SWASHGET" Some pure-perl code that perl was using to retrieve Unicode properties and transliteration mappings has been reimplemented in \s-1XS.\s0 .SS "Constant subroutines" .IX Subsection "Constant subroutines" The interpreter internals now support a far more memory efficient form of inlineable constants. Storing a reference to a constant value in a symbol table is equivalent to a full typeglob referencing a constant subroutine, but using about 400 bytes less memory. This proxy constant subroutine is automatically upgraded to a real typeglob with subroutine if necessary. The approach taken is analogous to the existing space optimisation for subroutine stub declarations, which are stored as plain scalars in place of the full typeglob. .PP Several of the core modules have been converted to use this feature for their system dependent constants \- as a result \f(CW\*(C`use POSIX;\*(C'\fR now takes about 200K less memory. .ie n .SS """PERL_DONT_CREATE_GVSV""" .el .SS "\f(CWPERL_DONT_CREATE_GVSV\fP" .IX Subsection "PERL_DONT_CREATE_GVSV" The new compilation flag \f(CW\*(C`PERL_DONT_CREATE_GVSV\*(C'\fR, introduced as an option in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl from creating an empty scalar with every new typeglob. See perl589delta for details. .SS "Weak references are cheaper" .IX Subsection "Weak references are cheaper" Weak reference creation is now \fIO(1)\fR rather than \fIO(n)\fR, courtesy of Nicholas Clark. Weak reference deletion remains \fIO(n)\fR, but if deletion only happens at program exit, it may be skipped completely. .SS "\fBsort()\fP enhancements" .IX Subsection "sort() enhancements" Salvador Fandin\*~o provided improvements to reduce the memory usage of \f(CW\*(C`sort\*(C'\fR and to speed up some cases. .SS "Memory optimisations" .IX Subsection "Memory optimisations" Several internal data structures (typeglobs, GVs, CVs, formats) have been restructured to use less memory. (Nicholas Clark) .SS "\s-1UTF\-8\s0 cache optimisation" .IX Subsection "UTF-8 cache optimisation" The \s-1UTF\-8\s0 caching code is now more efficient, and used more often. (Nicholas Clark) .SS "Sloppy stat on Windows" .IX Subsection "Sloppy stat on Windows" On Windows, perl's \fBstat()\fR function normally opens the file to determine the link count and update attributes that may have been changed through hard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds up \&\fBstat()\fR by not performing this operation. (Jan Dubois) .SS "Regular expressions optimisations" .IX Subsection "Regular expressions optimisations" .IP "Engine de-recursivised" 4 .IX Item "Engine de-recursivised" The regular expression engine is no longer recursive, meaning that patterns that used to overflow the stack will either die with useful explanations, or run to completion, which, since they were able to blow the stack before, will likely take a very long time to happen. If you were experiencing the occasional stack overflow (or segfault) and upgrade to discover that now perl apparently hangs instead, look for a degenerate regex. (Dave Mitchell) .IP "Single char char-classes treated as literals" 4 .IX Item "Single char char-classes treated as literals" Classes of a single character are now treated the same as if the character had been used as a literal, meaning that code that uses char-classes as an escaping mechanism will see a speedup. (Yves Orton) .IP "Trie optimisation of literal string alternations" 4 .IX Item "Trie optimisation of literal string alternations" Alternations, where possible, are optimised into more efficient matching structures. String literal alternations are merged into a trie and are matched simultaneously. This means that instead of O(N) time for matching N alternations at a given point, the new code performs in O(1) time. A new special variable, ${^RE_TRIE_MAXBUF}, has been added to fine-tune this optimization. (Yves Orton) .Sp \&\fBNote:\fR Much code exists that works around perl's historic poor performance on alternations. Often the tricks used to do so will disable the new optimisations. Hopefully the utility modules used for this purpose will be educated about these new optimisations. .IP "Aho-Corasick start-point optimisation" 4 .IX Item "Aho-Corasick start-point optimisation" When a pattern starts with a trie-able alternation and there aren't better optimisations available, the regex engine will use Aho-Corasick matching to find the start point. (Yves Orton) .SH "Installation and Configuration Improvements" .IX Header "Installation and Configuration Improvements" .SS "Configuration improvements" .IX Subsection "Configuration improvements" .ie n .IP """\-Dusesitecustomize""" 4 .el .IP "\f(CW\-Dusesitecustomize\fR" 4 .IX Item "-Dusesitecustomize" Run-time customization of \f(CW@INC\fR can be enabled by passing the \&\f(CW\*(C`\-Dusesitecustomize\*(C'\fR flag to Configure. When enabled, this will make perl run \fI\f(CI$sitelibexp\fI/sitecustomize.pl\fR before anything else. This script can then be set up to add additional entries to \f(CW@INC\fR. .IP "Relocatable installations" 4 .IX Item "Relocatable installations" There is now Configure support for creating a relocatable perl tree. If you Configure with \f(CW\*(C`\-Duserelocatableinc\*(C'\fR, then the paths in \f(CW@INC\fR (and everything else in \f(CW%Config\fR) can be optionally located via the path of the perl executable. .Sp That means that, if the string \f(CW".../"\fR is found at the start of any path, it's substituted with the directory of $^X. So, the relocation can be configured on a per-directory basis, although the default with \&\f(CW\*(C`\-Duserelocatableinc\*(C'\fR is that everything is relocated. The initial install is done to the original configured prefix. .IP "\fBstrlcat()\fR and \fBstrlcpy()\fR" 4 .IX Item "strlcat() and strlcpy()" The configuration process now detects whether \fBstrlcat()\fR and \fBstrlcpy()\fR are available. When they are not available, perl's own version is used (from Russ Allbery's public domain implementation). Various places in the perl interpreter now use them. (Steve Peters) .ie n .IP """d_pseudofork"" and ""d_printf_format_null""" 4 .el .IP "\f(CWd_pseudofork\fR and \f(CWd_printf_format_null\fR" 4 .IX Item "d_pseudofork and d_printf_format_null" A new configuration variable, available as \f(CW$Config{d_pseudofork}\fR in the Config module, has been added, to distinguish real \fBfork()\fR support from fake pseudofork used on Windows platforms. .Sp A new configuration variable, \f(CW\*(C`d_printf_format_null\*(C'\fR, has been added, to see if printf-like formats are allowed to be \s-1NULL.\s0 .IP "Configure help" 4 .IX Item "Configure help" \&\f(CW\*(C`Configure \-h\*(C'\fR has been extended with the most commonly used options. .SS "Compilation improvements" .IX Subsection "Compilation improvements" .IP "Parallel build" 4 .IX Item "Parallel build" Parallel makes should work properly now, although there may still be problems if \f(CW\*(C`make test\*(C'\fR is instructed to run in parallel. .IP "Borland's compilers support" 4 .IX Item "Borland's compilers support" Building with Borland's compilers on Win32 should work more smoothly. In particular Steve Hay has worked to side step many warnings emitted by their compilers and at least one C compiler internal error. .IP "Static build on Windows" 4 .IX Item "Static build on Windows" Perl extensions on Windows now can be statically built into the Perl \s-1DLL.\s0 .Sp Also, it's now possible to build a \f(CW\*(C`perl\-static.exe\*(C'\fR that doesn't depend on the Perl \s-1DLL\s0 on Win32. See the Win32 makefiles for details. (Vadim Konovalov) .IP "ppport.h files" 4 .IX Item "ppport.h files" All \fIppport.h\fR files in the \s-1XS\s0 modules bundled with perl are now autogenerated at build time. (Marcus Holland-Moritz) .IP "\*(C+ compatibility" 4 .IX Item " compatibility" Efforts have been made to make perl and the core \s-1XS\s0 modules compilable with various \*(C+ compilers (although the situation is not perfect with some of the compilers on some of the platforms tested.) .IP "Support for Microsoft 64\-bit compiler" 4 .IX Item "Support for Microsoft 64-bit compiler" Support for building perl with Microsoft's 64\-bit compiler has been improved. (ActiveState) .IP "Visual \*(C+" 4 .IX Item "Visual " Perl can now be compiled with Microsoft Visual \*(C+ 2005 (and 2008 Beta 2). .IP "Win32 builds" 4 .IX Item "Win32 builds" All win32 builds (MS-Win, WinCE) have been merged and cleaned up. .SS "Installation improvements" .IX Subsection "Installation improvements" .IP "Module auxiliary files" 4 .IX Item "Module auxiliary files" \&\s-1README\s0 files and changelogs for \s-1CPAN\s0 modules bundled with perl are no longer installed. .SS "New Or Improved Platforms" .IX Subsection "New Or Improved Platforms" Perl has been reported to work on Symbian \s-1OS.\s0 See perlsymbian for more information. .PP Many improvements have been made towards making Perl work correctly on z/OS. .PP Perl has been reported to work on DragonFlyBSD and MidnightBSD. .PP Perl has also been reported to work on NexentaOS ( http://www.gnusolaris.org/ ). .PP The \s-1VMS\s0 port has been improved. See perlvms. .PP Support for Cray \s-1XT4\s0 Catamount/Qk has been added. See \&\fIhints/catamount.sh\fR in the source code distribution for more information. .PP Vendor patches have been merged for RedHat and Gentoo. .PP \&\fBDynaLoader::dl_unload_file()\fR now works on Windows. .SH "Selected Bug Fixes" .IX Header "Selected Bug Fixes" .IP "strictures in regexp-eval blocks" 4 .IX Item "strictures in regexp-eval blocks" \&\f(CW\*(C`strict\*(C'\fR wasn't in effect in regexp-eval blocks (\f(CW\*(C`/(?{...})/\*(C'\fR). .IP "Calling \fBCORE::require()\fR" 4 .IX Item "Calling CORE::require()" \&\fBCORE::require()\fR and \fBCORE::do()\fR were always parsed as \fBrequire()\fR and \fBdo()\fR when they were overridden. This is now fixed. .IP "Subscripts of slices" 4 .IX Item "Subscripts of slices" You can now use a non-arrowed form for chained subscripts after a list slice, like in: .Sp .Vb 1 \& ({foo => "bar"})[0]{foo} .Ve .Sp This used to be a syntax error; a \f(CW\*(C`\->\*(C'\fR was required. .ie n .IP """no warnings \*(Aqcategory\*(Aq"" works correctly with \-w" 4 .el .IP "\f(CWno warnings \*(Aqcategory\*(Aq\fR works correctly with \-w" 4 .IX Item "no warnings category works correctly with -w" Previously when running with warnings enabled globally via \f(CW\*(C`\-w\*(C'\fR, selective disabling of specific warning categories would actually turn off all warnings. This is now fixed; now \f(CW\*(C`no warnings \*(Aqio\*(Aq;\*(C'\fR will only turn off warnings in the \&\f(CW\*(C`io\*(C'\fR class. Previously it would erroneously turn off all warnings. .IP "threads improvements" 4 .IX Item "threads improvements" Several memory leaks in ithreads were closed. Also, ithreads were made less memory-intensive. .Sp \&\f(CW\*(C`threads\*(C'\fR is now a dual-life module, also available on \s-1CPAN.\s0 It has been expanded in many ways. A \fBkill()\fR method is available for thread signalling. One can get thread status, or the list of running or joinable threads. .Sp A new \f(CW\*(C`threads\->exit()\*(C'\fR method is used to exit from the application (this is the default for the main thread) or from the current thread only (this is the default for all other threads). On the other hand, the \fBexit()\fR built-in now always causes the whole application to terminate. (Jerry D. Hedden) .IP "\fBchr()\fR and negative values" 4 .IX Item "chr() and negative values" \&\fBchr()\fR on a negative value now gives \f(CW\*(C`\ex{FFFD}\*(C'\fR, the Unicode replacement character, unless when the \f(CW\*(C`bytes\*(C'\fR pragma is in effect, where the low eight bits of the value are used. .IP "\s-1PERL5SHELL\s0 and tainting" 4 .IX Item "PERL5SHELL and tainting" On Windows, the \s-1PERL5SHELL\s0 environment variable is now checked for taintedness. (Rafael Garcia-Suarez) .IP "Using *FILE{\s-1IO\s0}" 4 .IX Item "Using *FILE{IO}" \&\f(CW\*(C`stat()\*(C'\fR and \f(CW\*(C`\-X\*(C'\fR filetests now treat *FILE{\s-1IO\s0} filehandles like *FILE filehandles. (Steve Peters) .IP "Overloading and reblessing" 4 .IX Item "Overloading and reblessing" Overloading now works when references are reblessed into another class. Internally, this has been implemented by moving the flag for \*(L"overloading\*(R" from the reference to the referent, which logically is where it should always have been. (Nicholas Clark) .IP "Overloading and \s-1UTF\-8\s0" 4 .IX Item "Overloading and UTF-8" A few bugs related to \s-1UTF\-8\s0 handling with objects that have stringification overloaded have been fixed. (Nicholas Clark) .IP "eval memory leaks fixed" 4 .IX Item "eval memory leaks fixed" Traditionally, \f(CW\*(C`eval \*(Aqsyntax error\*(Aq\*(C'\fR has leaked badly. Many (but not all) of these leaks have now been eliminated or reduced. (Dave Mitchell) .IP "Random device on Windows" 4 .IX Item "Random device on Windows" In previous versions, perl would read the file \fI/dev/urandom\fR if it existed when seeding its random number generator. That file is unlikely to exist on Windows, and if it did would probably not contain appropriate data, so perl no longer tries to read it on Windows. (Alex Davies) .IP "\s-1PERLIO_DEBUG\s0" 4 .IX Item "PERLIO_DEBUG" The \f(CW\*(C`PERLIO_DEBUG\*(C'\fR environment variable no longer has any effect for setuid scripts and for scripts run with \fB\-T\fR. .Sp Moreover, with a thread-enabled perl, using \f(CW\*(C`PERLIO_DEBUG\*(C'\fR could lead to an internal buffer overflow. This has been fixed. .IP "PerlIO::scalar and read-only scalars" 4 .IX Item "PerlIO::scalar and read-only scalars" PerlIO::scalar will now prevent writing to read-only scalars. Moreover, \&\fBseek()\fR is now supported with PerlIO::scalar\-based filehandles, the underlying string being zero-filled as needed. (Rafael, Jarkko Hietaniemi) .IP "\fBstudy()\fR and \s-1UTF\-8\s0" 4 .IX Item "study() and UTF-8" \&\fBstudy()\fR never worked for \s-1UTF\-8\s0 strings, but could lead to false results. It's now a no-op on \s-1UTF\-8\s0 data. (Yves Orton) .IP "Critical signals" 4 .IX Item "Critical signals" The signals \s-1SIGILL, SIGBUS\s0 and \s-1SIGSEGV\s0 are now always delivered in an \&\*(L"unsafe\*(R" manner (contrary to other signals, that are deferred until the perl interpreter reaches a reasonably stable state; see \&\*(L"Deferred Signals (Safe Signals)\*(R" in perlipc). (Rafael) .ie n .IP "@INC\-hook fix" 4 .el .IP "\f(CW@INC\fR\-hook fix" 4 .IX Item "@INC-hook fix" When a module or a file is loaded through an \f(CW@INC\fR\-hook, and when this hook has set a filename entry in \f(CW%INC\fR, _\|_FILE_\|_ is now set for this module accordingly to the contents of that \f(CW%INC\fR entry. (Rafael) .ie n .IP """\-t"" switch fix" 4 .el .IP "\f(CW\-t\fR switch fix" 4 .IX Item "-t switch fix" The \f(CW\*(C`\-w\*(C'\fR and \f(CW\*(C`\-t\*(C'\fR switches can now be used together without messing up which categories of warnings are activated. (Rafael) .IP "Duping \s-1UTF\-8\s0 filehandles" 4 .IX Item "Duping UTF-8 filehandles" Duping a filehandle which has the \f(CW\*(C`:utf8\*(C'\fR PerlIO layer set will now properly carry that layer on the duped filehandle. (Rafael) .IP "Localisation of hash elements" 4 .IX Item "Localisation of hash elements" Localizing a hash element whose key was given as a variable didn't work correctly if the variable was changed while the \fBlocal()\fR was in effect (as in \f(CW\*(C`local $h{$x}; ++$x\*(C'\fR). (Bo Lindbergh) .SH "New or Changed Diagnostics" .IX Header "New or Changed Diagnostics" .IP "Use of uninitialized value" 4 .IX Item "Use of uninitialized value" Perl will now try to tell you the name of the variable (if any) that was undefined. .IP "Deprecated use of \fBmy()\fR in false conditional" 4 .IX Item "Deprecated use of my() in false conditional" A new deprecation warning, \fIDeprecated use of \f(BImy()\fI in false conditional\fR, has been added, to warn against the use of the dubious and deprecated construct .Sp .Vb 1 \& my $x if 0; .Ve .Sp See perldiag. Use \f(CW\*(C`state\*(C'\fR variables instead. .IP "!=~ should be !~" 4 .IX Item "!=~ should be !~" A new warning, \f(CW\*(C`!=~ should be !~\*(C'\fR, is emitted to prevent this misspelling of the non-matching operator. .IP "Newline in left-justified string" 4 .IX Item "Newline in left-justified string" The warning \fINewline in left-justified string\fR has been removed. .ie n .IP "Too late for ""\-T"" option" 4 .el .IP "Too late for ``\-T'' option" 4 .IX Item "Too late for -T option" The error \fIToo late for \*(L"\-T\*(R" option\fR has been reformulated to be more descriptive. .ie n .IP """%s"" variable %s masks earlier declaration" 4 .el .IP "``%s'' variable \f(CW%s\fR masks earlier declaration" 4 .IX Item "%s variable %s masks earlier declaration" This warning is now emitted in more consistent cases; in short, when one of the declarations involved is a \f(CW\*(C`my\*(C'\fR variable: .Sp .Vb 3 \& my $x; my $x; # warns \& my $x; our $x; # warns \& our $x; my $x; # warns .Ve .Sp On the other hand, the following: .Sp .Vb 1 \& our $x; our $x; .Ve .Sp now gives a \f(CW\*(C`"our" variable %s redeclared\*(C'\fR warning. .IP "\fBreaddir()\fR/\fBclosedir()\fR/etc. attempted on invalid dirhandle" 4 .IX Item "readdir()/closedir()/etc. attempted on invalid dirhandle" These new warnings are now emitted when a dirhandle is used but is either closed or not really a dirhandle. .ie n .IP "Opening dirhandle/filehandle %s also as a file/directory" 4 .el .IP "Opening dirhandle/filehandle \f(CW%s\fR also as a file/directory" 4 .IX Item "Opening dirhandle/filehandle %s also as a file/directory" Two deprecation warnings have been added: (Rafael) .Sp .Vb 2 \& Opening dirhandle %s also as a file \& Opening filehandle %s also as a directory .Ve .IP "Use of \-P is deprecated" 4 .IX Item "Use of -P is deprecated" Perl's command-line switch \f(CW\*(C`\-P\*(C'\fR is now deprecated. .IP "v\-string in use/require is non-portable" 4 .IX Item "v-string in use/require is non-portable" Perl will warn you against potential backwards compatibility problems with the \f(CW\*(C`use VERSION\*(C'\fR syntax. .IP "perl \-V" 4 .IX Item "perl -V" \&\f(CW\*(C`perl \-V\*(C'\fR has several improvements, making it more useable from shell scripts to get the value of configuration variables. See perlrun for details. .SH "Changed Internals" .IX Header "Changed Internals" In general, the source code of perl has been refactored, tidied up, and optimized in many places. Also, memory management and allocation has been improved in several points. .PP When compiling the perl core with gcc, as many gcc warning flags are turned on as is possible on the platform. (This quest for cleanliness doesn't extend to \s-1XS\s0 code because we cannot guarantee the tidiness of code we didn't write.) Similar strictness flags have been added or tightened for various other C compilers. .SS "Reordering of SVt_* constants" .IX Subsection "Reordering of SVt_* constants" The relative ordering of constants that define the various types of \f(CW\*(C`SV\*(C'\fR have changed; in particular, \f(CW\*(C`SVt_PVGV\*(C'\fR has been moved before \f(CW\*(C`SVt_PVLV\*(C'\fR, \&\f(CW\*(C`SVt_PVAV\*(C'\fR, \f(CW\*(C`SVt_PVHV\*(C'\fR and \f(CW\*(C`SVt_PVCV\*(C'\fR. This is unlikely to make any difference unless you have code that explicitly makes assumptions about that ordering. (The inheritance hierarchy of \f(CW\*(C`B::*\*(C'\fR objects has been changed to reflect this.) .SS "Elimination of SVt_PVBM" .IX Subsection "Elimination of SVt_PVBM" Related to this, the internal type \f(CW\*(C`SVt_PVBM\*(C'\fR has been removed. This dedicated type of \f(CW\*(C`SV\*(C'\fR was used by the \f(CW\*(C`index\*(C'\fR operator and parts of the regexp engine to facilitate fast Boyer-Moore matches. Its use internally has been replaced by \f(CW\*(C`SV\*(C'\fRs of type \f(CW\*(C`SVt_PVGV\*(C'\fR. .SS "New type SVt_BIND" .IX Subsection "New type SVt_BIND" A new type \f(CW\*(C`SVt_BIND\*(C'\fR has been added, in readiness for the project to implement Perl 6 on 5. There deliberately is no implementation yet, and they cannot yet be created or destroyed. .SS "Removal of \s-1CPP\s0 symbols" .IX Subsection "Removal of CPP symbols" The C preprocessor symbols \f(CW\*(C`PERL_PM_APIVERSION\*(C'\fR and \&\f(CW\*(C`PERL_XS_APIVERSION\*(C'\fR, which were supposed to give the version number of the oldest perl binary-compatible (resp. source-compatible) with the present one, were not used, and sometimes had misleading values. They have been removed. .SS "Less space is used by ops" .IX Subsection "Less space is used by ops" The \f(CW\*(C`BASEOP\*(C'\fR structure now uses less space. The \f(CW\*(C`op_seq\*(C'\fR field has been removed and replaced by a single bit bit-field \f(CW\*(C`op_opt\*(C'\fR. \f(CW\*(C`op_type\*(C'\fR is now 9 bits long. (Consequently, the \f(CW\*(C`B::OP\*(C'\fR class doesn't provide an \f(CW\*(C`seq\*(C'\fR method anymore.) .SS "New parser" .IX Subsection "New parser" perl's parser is now generated by bison (it used to be generated by byacc.) As a result, it seems to be a bit more robust. .PP Also, Dave Mitchell improved the lexer debugging output under \f(CW\*(C`\-DT\*(C'\fR. .ie n .SS "Use of ""const""" .el .SS "Use of \f(CWconst\fP" .IX Subsection "Use of const" Andy Lester supplied many improvements to determine which function parameters and local variables could actually be declared \f(CW\*(C`const\*(C'\fR to the C compiler. Steve Peters provided new \f(CW*_set\fR macros and reworked the core to use these rather than assigning to macros in \s-1LVALUE\s0 context. .SS "Mathoms" .IX Subsection "Mathoms" A new file, \fImathoms.c\fR, has been added. It contains functions that are no longer used in the perl core, but that remain available for binary or source compatibility reasons. However, those functions will not be compiled in if you add \f(CW\*(C`\-DNO_MATHOMS\*(C'\fR in the compiler flags. .ie n .SS """AvFLAGS"" has been removed" .el .SS "\f(CWAvFLAGS\fP has been removed" .IX Subsection "AvFLAGS has been removed" The \f(CW\*(C`AvFLAGS\*(C'\fR macro has been removed. .ie n .SS """av_*"" changes" .el .SS "\f(CWav_*\fP changes" .IX Subsection "av_* changes" The \f(CW\*(C`av_*()\*(C'\fR functions, used to manipulate arrays, no longer accept null \&\f(CW\*(C`AV*\*(C'\fR parameters. .SS "$^H and %^H" .IX Subsection "$^H and %^H" The implementation of the special variables $^H and %^H has changed, to allow implementing lexical pragmas in pure Perl. .SS "B:: modules inheritance changed" .IX Subsection "B:: modules inheritance changed" The inheritance hierarchy of \f(CW\*(C`B::\*(C'\fR modules has changed; \f(CW\*(C`B::NV\*(C'\fR now inherits from \f(CW\*(C`B::SV\*(C'\fR (it used to inherit from \f(CW\*(C`B::IV\*(C'\fR). .SS "Anonymous hash and array constructors" .IX Subsection "Anonymous hash and array constructors" The anonymous hash and array constructors now take 1 op in the optree instead of 3, now that pp_anonhash and pp_anonlist return a reference to a hash/array when the op is flagged with OPf_SPECIAL. (Nicholas Clark) .SH "Known Problems" .IX Header "Known Problems" There's still a remaining problem in the implementation of the lexical \&\f(CW$_\fR: it doesn't work inside \f(CW\*(C`/(?{...})/\*(C'\fR blocks. (See the \s-1TODO\s0 test in \&\fIt/op/mydef.t\fR.) .PP Stacked filetest operators won't work when the \f(CW\*(C`filetest\*(C'\fR pragma is in effect, because they rely on the \fBstat()\fR buffer \f(CW\*(C`_\*(C'\fR being populated, and filetest bypasses \fBstat()\fR. .SS "\s-1UTF\-8\s0 problems" .IX Subsection "UTF-8 problems" The handling of Unicode still is unclean in several places, where it's dependent on whether a string is internally flagged as \s-1UTF\-8.\s0 This will be made more consistent in perl 5.12, but that won't be possible without a certain amount of backwards incompatibility. .SH "Platform Specific Problems" .IX Header "Platform Specific Problems" When compiled with g++ and thread support on Linux, it's reported that the \&\f(CW$!\fR stops working correctly. This is related to the fact that the glibc provides two \fBstrerror_r\fR\|(3) implementation, and perl selects the wrong one. .SH "Reporting Bugs" .IX Header "Reporting Bugs" If you find what you think is a bug, you might check the articles recently posted to the comp.lang.perl.misc newsgroup and the perl bug database at http://rt.perl.org/rt3/ . There may also be information at http://www.perl.org/ , the Perl Home Page. .PP If you believe you have an unreported bug, please run the \fBperlbug\fR program included with your release. Be sure to trim your bug down to a tiny but sufficient test case. Your bug report, along with the output of \f(CW\*(C`perl \-V\*(C'\fR, will be sent off to perlbug@perl.org to be analysed by the Perl porting team. .SH "SEE ALSO" .IX Header "SEE ALSO" The \fIChanges\fR file and the perl590delta to perl595delta man pages for exhaustive details on what changed. .PP The \fI\s-1INSTALL\s0\fR file for how to build Perl. .PP The \fI\s-1README\s0\fR file for general stuff. .PP The \fIArtistic\fR and \fICopying\fR files for copyright information.