Debian Codegraph @

upstream/mageia-cauldron/man1/perl5100delta.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "PERL5100DELTA 1"
61 .TH PERL5100DELTA 1 2023-12-22 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 perl5100delta \- what is new for perl 5.10.0
68 .SH DESCRIPTION
69 .IX Header "DESCRIPTION"
70 This document describes the differences between the 5.8.8 release and
71 the 5.10.0 release.
72 .PP
73 Many of the bug fixes in 5.10.0 were already seen in the 5.8.X maintenance
74 releases; they are not duplicated here and are documented in the set of
75 man pages named perl58[1\-8]?delta.
76 .SH "Core Enhancements"
77 .IX Header "Core Enhancements"
78 .ie n .SS "The ""feature"" pragma"
79 .el .SS "The \f(CWfeature\fP pragma"
80 .IX Subsection "The feature pragma"
81 The \f(CW\*(C`feature\*(C'\fR pragma is used to enable new syntax that would break Perl\*(Aqs
82 backwards\-compatibility with older releases of the language. It\*(Aqs a lexical
83 pragma, like \f(CW\*(C`strict\*(C'\fR or \f(CW\*(C`warnings\*(C'\fR.
84 .PP
85 Currently the following new features are available: \f(CW\*(C`switch\*(C'\fR (adds a
86 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
87 (adds a \f(CW\*(C`state\*(C'\fR keyword for declaring "static" variables). Those
88 features are described in their own sections of this document.
89 .PP
90 The \f(CW\*(C`feature\*(C'\fR pragma is also implicitly loaded when you require a minimal
91 perl version (with the \f(CW\*(C`use VERSION\*(C'\fR construct) greater than, or equal
92 to, 5.9.5. See feature for details.
93 .SS "New \fB\-E\fP command\-line switch"
94 .IX Subsection "New -E command-line switch"
95 \&\fB\-E\fR is equivalent to \fB\-e\fR, but it implicitly enables all
96 optional features (like \f(CW\*(C`use feature ":5.10"\*(C'\fR).
97 .SS "Defined\-or operator"
98 .IX Subsection "Defined-or operator"
99 A new operator \f(CW\*(C`//\*(C'\fR (defined\-or) has been implemented.
100 The following expression:
101 .PP
102 .Vb 1
103 \& $a // $b
104 .Ve
105 .PP
106 is merely equivalent to
107 .PP
108 .Vb 1
109 \& defined $a ? $a : $b
110 .Ve
111 .PP
112 and the statement
113 .PP
114 .Vb 1
115 \& $c //= $d;
116 .Ve
117 .PP
118 can now be used instead of
119 .PP
120 .Vb 1
121 \& $c = $d unless defined $c;
122 .Ve
123 .PP
124 The \f(CW\*(C`//\*(C'\fR operator has the same precedence and associativity as \f(CW\*(C`||\*(C'\fR.
125 Special care has been taken to ensure that this operator Do What You Mean
126 while not breaking old code, but some edge cases involving the empty
127 regular expression may now parse differently. See perlop for
128 details.
129 .SS "Switch and Smart Match operator"
130 .IX Subsection "Switch and Smart Match operator"
131 Perl 5 now has a switch statement. It\*(Aqs available when \f(CWuse feature
132 \&\*(Aqswitch\*(Aq\fR is in effect. This feature introduces three new keywords,
133 \&\f(CW\*(C`given\*(C'\fR, \f(CW\*(C`when\*(C'\fR, and \f(CW\*(C`default\*(C'\fR:
134 .PP
135 .Vb 6
136 \& given ($foo) {
137 \& when (/^abc/) { $abc = 1; }
138 \& when (/^def/) { $def = 1; }
139 \& when (/^xyz/) { $xyz = 1; }
140 \& default { $nothing = 1; }
141 \& }
142 .Ve
143 .PP
144 A more complete description of how Perl matches the switch variable
145 against the \f(CW\*(C`when\*(C'\fR conditions is given in "Switch statements" in perlsyn.
146 .PP
147 This kind of match is called \fIsmart match\fR, and it\*(Aqs also possible to use
148 it outside of switch statements, via the new \f(CW\*(C`~~\*(C'\fR operator. See
149 "Smart matching in detail" in perlsyn.
150 .PP
151 This feature was contributed by Robin Houston.
152 .SS "Regular expressions"
153 .IX Subsection "Regular expressions"
154 .IP "Recursive Patterns" 4
155 .IX Item "Recursive Patterns"
156 It is now possible to write recursive patterns without using the \f(CW\*(C`(??{})\*(C'\fR
157 construct. This new way is more efficient, and in many cases easier to
158 read.
159 .Sp
160 Each capturing parenthesis can now be treated as an independent pattern
161 that can be entered by using the \f(CW\*(C`(?PARNO)\*(C'\fR syntax (\f(CW\*(C`PARNO\*(C'\fR standing for
162 "parenthesis number"). For example, the following pattern will match
163 nested balanced angle brackets:
164 .Sp
165 .Vb 10
166 \& /
167 \& ^ # start of line
168 \& ( # start capture buffer 1
169 \& < # match an opening angle bracket
170 \& (?: # match one of:
171 \& (?> # don\*(Aqt backtrack over the inside of this group
172 \& [^<>]+ # one or more non angle brackets
173 \& ) # end non backtracking group
174 \& | # ... or ...
175 \& (?1) # recurse to bracket 1 and try it again
176 \& )* # 0 or more times.
177 \& > # match a closing angle bracket
178 \& ) # end capture buffer one
179 \& $ # end of line
180 \& /x
181 .Ve
182 .Sp
183 PCRE users should note that Perl\*(Aqs recursive regex feature allows
184 backtracking into a recursed pattern, whereas in PCRE the recursion is
185 atomic or "possessive" in nature. As in the example above, you can
186 add (?>) to control this selectively. (Yves Orton)
187 .IP "Named Capture Buffers" 4
188 .IX Item "Named Capture Buffers"
189 It is now possible to name capturing parenthesis in a pattern and refer to
190 the captured contents by name. The naming syntax is \f(CW\*(C`(?<NAME>....)\*(C'\fR.
191 It\*(Aqs possible to backreference to a named buffer with the \f(CW\*(C`\ek<NAME>\*(C'\fR
192 syntax. In code, the new magical hashes \f(CW\*(C`%+\*(C'\fR and \f(CW\*(C`%\-\*(C'\fR can be used to
193 access the contents of the capture buffers.
194 .Sp
195 Thus, to replace all doubled chars with a single copy, one could write
196 .Sp
197 .Vb 1
198 \& s/(?<letter>.)\ek<letter>/$+{letter}/g
199 .Ve
200 .Sp
201 Only buffers with defined contents will be "visible" in the \f(CW\*(C`%+\*(C'\fR hash, so
202 it\*(Aqs possible to do something like
203 .Sp
204 .Vb 3
205 \& foreach my $name (keys %+) {
206 \& print "content of buffer \*(Aq$name\*(Aq is $+{$name}\en";
207 \& }
208 .Ve
209 .Sp
210 The \f(CW\*(C`%\-\*(C'\fR hash is a bit more complete, since it will contain array refs
211 holding values from all capture buffers similarly named, if there should
212 be many of them.
213 .Sp
214 \&\f(CW\*(C`%+\*(C'\fR and \f(CW\*(C`%\-\*(C'\fR are implemented as tied hashes through the new module
215 \&\f(CW\*(C`Tie::Hash::NamedCapture\*(C'\fR.
216 .Sp
217 Users exposed to the .NET regex engine will find that the perl
218 implementation differs in that the numerical ordering of the buffers
219 is sequential, and not "unnamed first, then named". Thus in the pattern
220 .Sp
221 .Vb 1
222 \& /(A)(?<B>B)(C)(?<D>D)/
223 .Ve
224 .Sp
225 \&\f(CW$1\fR will be \*(AqA\*(Aq, \f(CW$2\fR will be \*(AqB\*(Aq, \f(CW$3\fR will be \*(AqC\*(Aq and \f(CW$4\fR will be \*(AqD\*(Aq and not
226 \&\f(CW$1\fR is \*(AqA\*(Aq, \f(CW$2\fR is \*(AqC\*(Aq and \f(CW$3\fR is \*(AqB\*(Aq and \f(CW$4\fR is \*(AqD\*(Aq that a .NET programmer
227 would expect. This is considered a feature. :\-) (Yves Orton)
228 .IP "Possessive Quantifiers" 4
229 .IX Item "Possessive Quantifiers"
230 Perl now supports the "possessive quantifier" syntax of the "atomic match"
231 pattern. Basically a possessive quantifier matches as much as it can and never
232 gives any back. Thus it can be used to control backtracking. The syntax is
233 similar to non\-greedy matching, except instead of using a \*(Aq?\*(Aq as the modifier
234 the \*(Aq+\*(Aq 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
235 quantifiers. (Yves Orton)
236 .IP "Backtracking control verbs" 4
237 .IX Item "Backtracking control verbs"
238 The regex engine now supports a number of special\-purpose backtrack
239 control verbs: (*THEN), (*PRUNE), (*MARK), (*SKIP), (*COMMIT), (*FAIL)
240 and (*ACCEPT). See perlre for their descriptions. (Yves Orton)
241 .IP "Relative backreferences" 4
242 .IX Item "Relative backreferences"
243 A new syntax \f(CW\*(C`\eg{N}\*(C'\fR or \f(CW\*(C`\egN\*(C'\fR where "N" is a decimal integer allows a
244 safer form of back\-reference notation as well as allowing relative
245 backreferences. This should make it easier to generate and embed patterns
246 that contain backreferences. See "Capture buffers" in perlre. (Yves Orton)
247 .ie n .IP """\eK"" escape" 4
248 .el .IP "\f(CW\eK\fR escape" 4
249 .IX Item "K escape"
250 The functionality of Jeff Pinyan\*(Aqs module Regexp::Keep has been added to
251 the core. In regular expressions you can now use the special escape \f(CW\*(C`\eK\*(C'\fR
252 as a way to do something like floating length positive lookbehind. It is
253 also useful in substitutions like:
254 .Sp
255 .Vb 1
256 \& s/(foo)bar/$1/g
257 .Ve
258 .Sp
259 that can now be converted to
260 .Sp
261 .Vb 1
262 \& s/foo\eKbar//g
263 .Ve
264 .Sp
265 which is much more efficient. (Yves Orton)
266 .IP "Vertical and horizontal whitespace, and linebreak" 4
267 .IX Item "Vertical and horizontal whitespace, and linebreak"
268 Regular expressions now recognize the \f(CW\*(C`\ev\*(C'\fR and \f(CW\*(C`\eh\*(C'\fR escapes that match
269 vertical and horizontal whitespace, respectively. \f(CW\*(C`\eV\*(C'\fR and \f(CW\*(C`\eH\*(C'\fR
270 logically match their complements.
271 .Sp
272 \&\f(CW\*(C`\eR\*(C'\fR matches a generic linebreak, that is, vertical whitespace, plus
273 the multi\-character sequence \f(CW"\ex0D\ex0A"\fR.
274 .IP "Optional pre\-match and post\-match captures with the /p flag" 4
275 .IX Item "Optional pre-match and post-match captures with the /p flag"
276 There is a new flag \f(CW\*(C`/p\*(C'\fR for regular expressions. Using this
277 makes the engine preserve a copy of the part of the matched string before
278 the matching substring to the new special variable \f(CW\*(C`${^PREMATCH}\*(C'\fR, the
279 part after the matching substring to \f(CW\*(C`${^POSTMATCH}\*(C'\fR, and the matched
280 substring itself to \f(CW\*(C`${^MATCH}\*(C'\fR.
281 .Sp
282 Perl is still able to store these substrings to the special variables
283 \&\f(CW\*(C`$\`\*(C'\fR, \f(CW\*(C`$\*(Aq\*(C'\fR, \f(CW$&\fR, but using these variables anywhere in the program
284 adds a penalty to all regular expression matches, whereas if you use
285 the \f(CW\*(C`/p\*(C'\fR flag and the new special variables instead, you pay only for
286 the regular expressions where the flag is used.
287 .Sp
288 For more detail on the new variables, see perlvar; for the use of
289 the regular expression flag, see perlop and perlre.
290 .ie n .SS say()
291 .el .SS \f(CWsay()\fP
292 .IX Subsection "say()"
293 \&\fBsay()\fR is a new built\-in, only available when \f(CW\*(C`use feature \*(Aqsay\*(Aq\*(C'\fR is in
294 effect, that is similar to \fBprint()\fR, but that implicitly appends a newline
295 to the printed string. See "say" in perlfunc. (Robin Houston)
296 .ie n .SS "Lexical $_"
297 .el .SS "Lexical \f(CW$_\fP"
298 .IX Subsection "Lexical $_"
299 The default variable \f(CW$_\fR can now be lexicalized, by declaring it like
300 any other lexical variable, with a simple
301 .PP
302 .Vb 1
303 \& my $_;
304 .Ve
305 .PP
306 The operations that default on \f(CW$_\fR will use the lexically\-scoped
307 version of \f(CW$_\fR when it exists, instead of the global \f(CW$_\fR.
308 .PP
309 In a \f(CW\*(C`map\*(C'\fR or a \f(CW\*(C`grep\*(C'\fR block, if \f(CW$_\fR was previously my\*(Aqed, then the
310 \&\f(CW$_\fR inside the block is lexical as well (and scoped to the block).
311 .PP
312 In a scope where \f(CW$_\fR has been lexicalized, you can still have access to
313 the global version of \f(CW$_\fR by using \f(CW$::_\fR, or, more simply, by
314 overriding the lexical declaration with \f(CW\*(C`our $_\*(C'\fR. (Rafael Garcia\-Suarez)
315 .ie n .SS "The ""_"" prototype"
316 .el .SS "The \f(CW_\fP prototype"
317 .IX Subsection "The _ prototype"
318 A new prototype character has been added. \f(CW\*(C`_\*(C'\fR is equivalent to \f(CW\*(C`$\*(C'\fR but
319 defaults to \f(CW$_\fR if the corresponding argument isn\*(Aqt supplied (both \f(CW\*(C`$\*(C'\fR
320 and \f(CW\*(C`_\*(C'\fR denote a scalar). Due to the optional nature of the argument,
321 you can only use it at the end of a prototype, or before a semicolon.
322 .PP
323 This has a small incompatible consequence: the \fBprototype()\fR function has
324 been adjusted to return \f(CW\*(C`_\*(C'\fR for some built\-ins in appropriate cases (for
325 example, \f(CWprototype(\*(AqCORE::rmdir\*(Aq)\fR). (Rafael Garcia\-Suarez)
326 .SS "UNITCHECK blocks"
327 .IX Subsection "UNITCHECK blocks"
328 \&\f(CW\*(C`UNITCHECK\*(C'\fR, a new special code block has been introduced, in addition to
329 \&\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.
330 .PP
331 \&\f(CW\*(C`CHECK\*(C'\fR and \f(CW\*(C`INIT\*(C'\fR blocks, while useful for some specialized purposes,
332 are always executed at the transition between the compilation and the
333 execution of the main program, and thus are useless whenever code is
334 loaded at runtime. On the other hand, \f(CW\*(C`UNITCHECK\*(C'\fR blocks are executed
335 just after the unit which defined them has been compiled. See perlmod
336 for more information. (Alex Gough)
337 .ie n .SS "New Pragma, ""mro"""
338 .el .SS "New Pragma, \f(CWmro\fP"
339 .IX Subsection "New Pragma, mro"
340 A new pragma, \f(CW\*(C`mro\*(C'\fR (for Method Resolution Order) has been added. It
341 permits to switch, on a per\-class basis, the algorithm that perl uses to
342 find inherited methods in case of a multiple inheritance hierarchy. The
343 default MRO hasn\*(Aqt changed (DFS, for Depth First Search). Another MRO is
344 available: the C3 algorithm. See mro for more information.
345 (Brandon Black)
346 .PP
347 Note that, due to changes in the implementation of class hierarchy search,
348 code that used to undef the \f(CW*ISA\fR glob will most probably break. Anyway,
349 undef\*(Aqing \f(CW*ISA\fR had the side\-effect of removing the magic on the \f(CW@ISA\fR
350 array and should not have been done in the first place. Also, the
351 cache \f(CW*::ISA::CACHE::\fR no longer exists; to force reset the \f(CW@ISA\fR cache,
352 you now need to use the \f(CW\*(C`mro\*(C'\fR API, or more simply to assign to \f(CW@ISA\fR
353 (e.g. with \f(CW\*(C`@ISA = @ISA\*(C'\fR).
354 .SS "\fBreaddir()\fP may return a ""short filename"" on Windows"
355 .IX Subsection "readdir() may return a ""short filename"" on Windows"
356 The \fBreaddir()\fR function may return a "short filename" when the long
357 filename contains characters outside the ANSI codepage. Similarly
358 \&\fBCwd::cwd()\fR may return a short directory name, and \fBglob()\fR may return short
359 names as well. On the NTFS file system these short names can always be
360 represented in the ANSI codepage. This will not be true for all other file
361 system drivers; e.g. the FAT filesystem stores short filenames in the OEM
362 codepage, so some files on FAT volumes remain inaccessible through the
363 ANSI APIs.
364 .PP
365 Similarly, $^X, \f(CW@INC\fR, and \f(CW$ENV\fR{PATH} are preprocessed at startup to make
366 sure all paths are valid in the ANSI codepage (if possible).
367 .PP
368 The \fBWin32::GetLongPathName()\fR function now returns the UTF\-8 encoded
369 correct long file name instead of using replacement characters to force
370 the name into the ANSI codepage. The new \fBWin32::GetANSIPathName()\fR
371 function can be used to turn a long pathname into a short one only if the
372 long one cannot be represented in the ANSI codepage.
373 .PP
374 Many other functions in the \f(CW\*(C`Win32\*(C'\fR module have been improved to accept
375 UTF\-8 encoded arguments. Please see Win32 for details.
376 .SS "\fBreadpipe()\fP is now overridable"
377 .IX Subsection "readpipe() is now overridable"
378 The built\-in function \fBreadpipe()\fR is now overridable. Overriding it permits
379 also to override its operator counterpart, \f(CW\*(C`qx//\*(C'\fR (a.k.a. \f(CW\`\`\fR).
380 Moreover, it now defaults to \f(CW$_\fR if no argument is provided. (Rafael
381 Garcia\-Suarez)
382 .SS "Default argument for \fBreadline()\fP"
383 .IX Subsection "Default argument for readline()"
384 \&\fBreadline()\fR now defaults to \f(CW*ARGV\fR if no argument is provided. (Rafael
385 Garcia\-Suarez)
386 .SS "\fBstate()\fP variables"
387 .IX Subsection "state() variables"
388 A new class of variables has been introduced. State variables are similar
389 to \f(CW\*(C`my\*(C'\fR variables, but are declared with the \f(CW\*(C`state\*(C'\fR keyword in place of
390 \&\f(CW\*(C`my\*(C'\fR. They\*(Aqre visible only in their lexical scope, but their value is
391 persistent: unlike \f(CW\*(C`my\*(C'\fR variables, they\*(Aqre not undefined at scope entry,
392 but retain their previous value. (Rafael Garcia\-Suarez, Nicholas Clark)
393 .PP
394 To use state variables, one needs to enable them by using
395 .PP
396 .Vb 1
397 \& use feature \*(Aqstate\*(Aq;
398 .Ve
399 .PP
400 or by using the \f(CW\*(C`\-E\*(C'\fR command\-line switch in one\-liners.
401 See "Persistent Private Variables" in perlsub.
402 .SS "Stacked filetest operators"
403 .IX Subsection "Stacked filetest operators"
404 As a new form of syntactic sugar, it\*(Aqs now possible to stack up filetest
405 operators. You can now write \f(CW\*(C`\-f \-w \-x $file\*(C'\fR in a row to mean
406 \&\f(CW\*(C`\-x $file && \-w _ && \-f _\*(C'\fR. See "\-X" in perlfunc.
407 .SS \fBUNIVERSAL::DOES()\fP
408 .IX Subsection "UNIVERSAL::DOES()"
409 The \f(CW\*(C`UNIVERSAL\*(C'\fR class has a new method, \f(CWDOES()\fR. It has been added to
410 solve semantic problems with the \f(CWisa()\fR method. \f(CWisa()\fR checks for
411 inheritance, while \f(CWDOES()\fR has been designed to be overridden when
412 module authors use other types of relations between classes (in addition
413 to inheritance). (chromatic)
414 .PP
415 See "$obj\->DOES( ROLE )" in UNIVERSAL.
416 .SS Formats
417 .IX Subsection "Formats"
418 Formats were improved in several ways. A new field, \f(CW\*(C`^*\*(C'\fR, can be used for
419 variable\-width, one\-line\-at\-a\-time text. Null characters are now handled
420 correctly in picture lines. Using \f(CW\*(C`@#\*(C'\fR and \f(CW\*(C`~~\*(C'\fR together will now
421 produce a compile\-time error, as those format fields are incompatible.
422 perlform has been improved, and miscellaneous bugs fixed.
423 .SS "Byte\-order modifiers for \fBpack()\fP and \fBunpack()\fP"
424 .IX Subsection "Byte-order modifiers for pack() and unpack()"
425 There are two new byte\-order modifiers, \f(CW\*(C`>\*(C'\fR (big\-endian) and \f(CW\*(C`<\*(C'\fR
426 (little\-endian), that can be appended to most \fBpack()\fR and \fBunpack()\fR template
427 characters and groups to force a certain byte\-order for that type or group.
428 See "pack" in perlfunc and perlpacktut for details.
429 .ie n .SS """no VERSION"""
430 .el .SS "\f(CWno VERSION\fP"
431 .IX Subsection "no VERSION"
432 You can now use \f(CW\*(C`no\*(C'\fR followed by a version number to specify that you
433 want to use a version of perl older than the specified one.
434 .ie n .SS """chdir"", ""chmod"" and ""chown"" on filehandles"
435 .el .SS "\f(CWchdir\fP, \f(CWchmod\fP and \f(CWchown\fP on filehandles"
436 .IX Subsection "chdir, chmod and chown on filehandles"
437 \&\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
438 filenames, if the system supports respectively \f(CW\*(C`fchdir\*(C'\fR, \f(CW\*(C`fchmod\*(C'\fR and
439 \&\f(CW\*(C`fchown\*(C'\fR, thanks to a patch provided by Gisle Aas.
440 .SS "OS groups"
441 .IX Subsection "OS groups"
442 \&\f(CW$(\fR and \f(CW$)\fR now return groups in the order where the OS returns them,
443 thanks to Gisle Aas. This wasn\*(Aqt previously the case.
444 .SS "Recursive sort subs"
445 .IX Subsection "Recursive sort subs"
446 You can now use recursive subroutines with \fBsort()\fR, thanks to Robin Houston.
447 .SS "Exceptions in constant folding"
448 .IX Subsection "Exceptions in constant folding"
449 The constant folding routine is now wrapped in an exception handler, and
450 if folding throws an exception (such as attempting to evaluate 0/0), perl
451 now retains the current optree, rather than aborting the whole program.
452 Without this change, programs would not compile if they had expressions that
453 happened to generate exceptions, even though those expressions were in code
454 that could never be reached at runtime. (Nicholas Clark, Dave Mitchell)
455 .ie n .SS "Source filters in @INC"
456 .el .SS "Source filters in \f(CW@INC\fP"
457 .IX Subsection "Source filters in @INC"
458 It\*(Aqs possible to enhance the mechanism of subroutine hooks in \f(CW@INC\fR by
459 adding a source filter on top of the filehandle opened and returned by the
460 hook. This feature was planned a long time ago, but wasn\*(Aqt quite working
461 until now. See "require" in perlfunc for details. (Nicholas Clark)
462 .SS "New internal variables"
463 .IX Subsection "New internal variables"
464 .ie n .IP """${^RE_DEBUG_FLAGS}""" 4
465 .el .IP \f(CW${^RE_DEBUG_FLAGS}\fR 4
466 .IX Item "${^RE_DEBUG_FLAGS}"
467 This variable controls what debug flags are in effect for the regular
468 expression engine when running under \f(CW\*(C`use re "debug"\*(C'\fR. See re for
469 details.
470 .ie n .IP """${^CHILD_ERROR_NATIVE}""" 4
471 .el .IP \f(CW${^CHILD_ERROR_NATIVE}\fR 4
472 .IX Item "${^CHILD_ERROR_NATIVE}"
473 This variable gives the native status returned by the last pipe close,
474 backtick command, successful call to \fBwait()\fR or \fBwaitpid()\fR, or from the
475 \&\fBsystem()\fR operator. See perlvar for details. (Contributed by Gisle Aas.)
476 .ie n .IP """${^RE_TRIE_MAXBUF}""" 4
477 .el .IP \f(CW${^RE_TRIE_MAXBUF}\fR 4
478 .IX Item "${^RE_TRIE_MAXBUF}"
479 See "Trie optimisation of literal string alternations".
480 .ie n .IP """${^WIN32_SLOPPY_STAT}""" 4
481 .el .IP \f(CW${^WIN32_SLOPPY_STAT}\fR 4
482 .IX Item "${^WIN32_SLOPPY_STAT}"
483 See "Sloppy stat on Windows".
484 .SS Miscellaneous
485 .IX Subsection "Miscellaneous"
486 \&\f(CWunpack()\fR now defaults to unpacking the \f(CW$_\fR variable.
487 .PP
488 \&\f(CWmkdir()\fR without arguments now defaults to \f(CW$_\fR.
489 .PP
490 The internal dump output has been improved, so that non\-printable characters
491 such as newline and backspace are output in \f(CW\*(C`\ex\*(C'\fR notation, rather than
492 octal.
493 .PP
494 The \fB\-C\fR option can no longer be used on the \f(CW\*(C`#!\*(C'\fR line. It wasn\*(Aqt
495 working there anyway, since the standard streams are already set up
496 at this point in the execution of the perl interpreter. You can use
497 \&\fBbinmode()\fR instead to get the desired behaviour.
498 .SS "UCD 5.0.0"
499 .IX Subsection "UCD 5.0.0"
500 The copy of the Unicode Character Database included in Perl 5 has
501 been updated to version 5.0.0.
502 .SS MAD
503 .IX Subsection "MAD"
504 MAD, which stands for \fIMiscellaneous Attribute Decoration\fR, is a
505 still\-in\-development work leading to a Perl 5 to Perl 6 converter. To
506 enable it, it\*(Aqs necessary to pass the argument \f(CW\*(C`\-Dmad\*(C'\fR to Configure. The
507 obtained perl isn\*(Aqt binary compatible with a regular perl 5.10, and has
508 space and speed penalties; moreover not all regression tests still pass
509 with it. (Larry Wall, Nicholas Clark)
510 .SS "\fBkill()\fP on Windows"
511 .IX Subsection "kill() on Windows"
512 On Windows platforms, \f(CW\*(C`kill(\-9, $pid)\*(C'\fR now kills a process tree.
513 (On Unix, this delivers the signal to all processes in the same process
514 group.)
515 .SH "Incompatible Changes"
516 .IX Header "Incompatible Changes"
517 .SS "Packing and UTF\-8 strings"
518 .IX Subsection "Packing and UTF-8 strings"
519 The semantics of \fBpack()\fR and \fBunpack()\fR regarding UTF\-8\-encoded data has been
520 changed. Processing is now by default character per character instead of
521 byte per byte on the underlying encoding. Notably, code that used things
522 like \f(CW\*(C`pack("a*", $string)\*(C'\fR to see through the encoding of string will now
523 simply get back the original \f(CW$string\fR. Packed strings can also get upgraded
524 during processing when you store upgraded characters. You can get the old
525 behaviour by using \f(CW\*(C`use bytes\*(C'\fR.
526 .PP
527 To be consistent with \fBpack()\fR, the \f(CW\*(C`C0\*(C'\fR in \fBunpack()\fR templates indicates
528 that the data is to be processed in character mode, i.e. character by
529 character; on the contrary, \f(CW\*(C`U0\*(C'\fR in \fBunpack()\fR indicates UTF\-8 mode, where
530 the packed string is processed in its UTF\-8\-encoded Unicode form on a byte
531 by byte basis. This is reversed with regard to perl 5.8.X, but now consistent
532 between \fBpack()\fR and \fBunpack()\fR.
533 .PP
534 Moreover, \f(CW\*(C`C0\*(C'\fR and \f(CW\*(C`U0\*(C'\fR can also be used in \fBpack()\fR templates to specify
535 respectively character and byte modes.
536 .PP
537 \&\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
538 specified encoding mode, honoring parens grouping. Previously, parens were
539 ignored.
540 .PP
541 Also, there is a new \fBpack()\fR character format, \f(CW\*(C`W\*(C'\fR, which is intended to
542 replace the old \f(CW\*(C`C\*(C'\fR. \f(CW\*(C`C\*(C'\fR is kept for unsigned chars coded as bytes in
543 the strings internal representation. \f(CW\*(C`W\*(C'\fR represents unsigned (logical)
544 character values, which can be greater than 255. It is therefore more
545 robust when dealing with potentially UTF\-8\-encoded data (as \f(CW\*(C`C\*(C'\fR will wrap
546 values outside the range 0..255, and not respect the string encoding).
547 .PP
548 In practice, that means that pack formats are now encoding\-neutral, except
549 \&\f(CW\*(C`C\*(C'\fR.
550 .PP
551 For consistency, \f(CW\*(C`A\*(C'\fR in \fBunpack()\fR format now trims all Unicode whitespace
552 from the end of the string. Before perl 5.9.2, it used to strip only the
553 classical ASCII space characters.
554 .SS "Byte/character count feature in \fBunpack()\fP"
555 .IX Subsection "Byte/character count feature in unpack()"
556 A new \fBunpack()\fR template character, \f(CW"."\fR, returns the number of bytes or
557 characters (depending on the selected encoding mode, see above) read so far.
558 .ie n .SS "The $* and $# variables have been removed"
559 .el .SS "The \f(CW$*\fP and \f(CW$#\fP variables have been removed"
560 .IX Subsection "The $* and $# variables have been removed"
561 \&\f(CW$*\fR, which was deprecated in favor of the \f(CW\*(C`/s\*(C'\fR and \f(CW\*(C`/m\*(C'\fR regexp
562 modifiers, has been removed.
563 .PP
564 The deprecated \f(CW$#\fR variable (output format for numbers) has been
565 removed.
566 .PP
567 Two new severe warnings, \f(CW\*(C`$#/$* is no longer supported\*(C'\fR, have been added.
568 .SS "\fBsubstr()\fP lvalues are no longer fixed\-length"
569 .IX Subsection "substr() lvalues are no longer fixed-length"
570 The lvalues returned by the three argument form of \fBsubstr()\fR used to be a
571 "fixed length window" on the original string. In some cases this could
572 cause surprising action at distance or other undefined behaviour. Now the
573 length of the window adjusts itself to the length of the string assigned to
574 it.
575 .ie n .SS "Parsing of ""\-f _"""
576 .el .SS "Parsing of \f(CW\-f _\fP"
577 .IX Subsection "Parsing of -f _"
578 The identifier \f(CW\*(C`_\*(C'\fR is now forced to be a bareword after a filetest
579 operator. This solves a number of misparsing issues when a global \f(CW\*(C`_\*(C'\fR
580 subroutine is defined.
581 .ie n .SS """:unique"""
582 .el .SS \f(CW:unique\fP
583 .IX Subsection ":unique"
584 The \f(CW\*(C`:unique\*(C'\fR attribute has been made a no\-op, since its current
585 implementation was fundamentally flawed and not threadsafe.
586 .SS "Effect of pragmas in eval"
587 .IX Subsection "Effect of pragmas in eval"
588 The compile\-time value of the \f(CW\*(C`%^H\*(C'\fR hint variable can now propagate into
589 eval("")uated code. This makes it more useful to implement lexical
590 pragmas.
591 .PP
592 As a side\-effect of this, the overloaded\-ness of constants now propagates
593 into eval("").
594 .SS "chdir FOO"
595 .IX Subsection "chdir FOO"
596 A bareword argument to \fBchdir()\fR is now recognized as a file handle.
597 Earlier releases interpreted the bareword as a directory name.
598 (Gisle Aas)
599 .SS "Handling of .pmc files"
600 .IX Subsection "Handling of .pmc files"
601 An old feature of perl was that before \f(CW\*(C`require\*(C'\fR or \f(CW\*(C`use\*(C'\fR look for a
602 file with a \fI.pm\fR extension, they will first look for a similar filename
603 with a \fI.pmc\fR extension. If this file is found, it will be loaded in
604 place of any potentially existing file ending in a \fI.pm\fR extension.
605 .PP
606 Previously, \fI.pmc\fR files were loaded only if more recent than the
607 matching \fI.pm\fR file. Starting with 5.9.4, they\*(Aqll be always loaded if
608 they exist.
609 .ie n .SS "$^V is now a ""version"" object instead of a v\-string"
610 .el .SS "$^V is now a \f(CWversion\fP object instead of a v\-string"
611 .IX Subsection "$^V is now a version object instead of a v-string"
612 $^V can still be used with the \f(CW%vd\fR format in printf, but any
613 character\-level operations will now access the string representation
614 of the \f(CW\*(C`version\*(C'\fR object and not the ordinals of a v\-string.
615 Expressions like \f(CW\*(C`substr($^V, 0, 2)\*(C'\fR or \f(CW\*(C`split //, $^V\*(C'\fR
616 no longer work and must be rewritten.
617 .SS "@\- and @+ in patterns"
618 .IX Subsection "@- and @+ in patterns"
619 The special arrays \f(CW\*(C`@\-\*(C'\fR and \f(CW\*(C`@+\*(C'\fR are no longer interpolated in regular
620 expressions. (Sadahiro Tomoyuki)
621 .ie n .SS "$AUTOLOAD can now be tainted"
622 .el .SS "\f(CW$AUTOLOAD\fP can now be tainted"
623 .IX Subsection "$AUTOLOAD can now be tainted"
624 If you call a subroutine by a tainted name, and if it defers to an
625 AUTOLOAD function, then \f(CW$AUTOLOAD\fR will be (correctly) tainted.
626 (Rick Delaney)
627 .SS "Tainting and printf"
628 .IX Subsection "Tainting and printf"
629 When perl is run under taint mode, \f(CWprintf()\fR and \f(CWsprintf()\fR will now
630 reject any tainted format argument. (Rafael Garcia\-Suarez)
631 .SS "undef and signal handlers"
632 .IX Subsection "undef and signal handlers"
633 Undefining or deleting a signal handler via \f(CW\*(C`undef $SIG{FOO}\*(C'\fR is now
634 equivalent to setting it to \f(CW\*(AqDEFAULT\*(Aq\fR. (Rafael Garcia\-Suarez)
635 .SS "strictures and dereferencing in \fBdefined()\fP"
636 .IX Subsection "strictures and dereferencing in defined()"
637 \&\f(CW\*(C`use strict \*(Aqrefs\*(Aq\*(C'\fR was ignoring taking a hard reference in an argument
638 to \fBdefined()\fR, as in :
639 .PP
640 .Vb 3
641 \& use strict \*(Aqrefs\*(Aq;
642 \& my $x = \*(Aqfoo\*(Aq;
643 \& if (defined $$x) {...}
644 .Ve
645 .PP
646 This now correctly produces the run\-time error \f(CW\*(C`Can\*(Aqt use string as a
647 SCALAR ref while "strict refs" in use\*(C'\fR.
648 .PP
649 \&\f(CW\*(C`defined @$foo\*(C'\fR and \f(CW\*(C`defined %$bar\*(C'\fR are now also subject to \f(CWstrict
650 \&\*(Aqrefs\*(Aq\fR (that is, \f(CW$foo\fR and \f(CW$bar\fR shall be proper references there.)
651 (\f(CWdefined(@foo)\fR and \f(CWdefined(%bar)\fR are discouraged constructs anyway.)
652 (Nicholas Clark)
653 .ie n .SS """(?p{})"" has been removed"
654 .el .SS "\f(CW(?p{})\fP has been removed"
655 .IX Subsection "(?p{}) has been removed"
656 The regular expression construct \f(CW\*(C`(?p{})\*(C'\fR, which was deprecated in perl
657 5.8, has been removed. Use \f(CW\*(C`(??{})\*(C'\fR instead. (Rafael Garcia\-Suarez)
658 .SS "Pseudo\-hashes have been removed"
659 .IX Subsection "Pseudo-hashes have been removed"
660 Support for pseudo\-hashes has been removed from Perl 5.9. (The \f(CW\*(C`fields\*(C'\fR
661 pragma remains here, but uses an alternate implementation.)
662 .SS "Removal of the bytecode compiler and of perlcc"
663 .IX Subsection "Removal of the bytecode compiler and of perlcc"
664 \&\f(CW\*(C`perlcc\*(C'\fR, the byteloader and the supporting modules (B::C, B::CC,
665 B::Bytecode, etc.) are no longer distributed with the perl sources. Those
666 experimental tools have never worked reliably, and, due to the lack of
667 volunteers to keep them in line with the perl interpreter developments, it
668 was decided to remove them instead of shipping a broken version of those.
669 The last version of those modules can be found with perl 5.9.4.
670 .PP
671 However the B compiler framework stays supported in the perl core, as with
672 the more useful modules it has permitted (among others, B::Deparse and
673 B::Concise).
674 .SS "Removal of the JPL"
675 .IX Subsection "Removal of the JPL"
676 The JPL (Java\-Perl Lingo) has been removed from the perl sources tarball.
677 .SS "Recursive inheritance detected earlier"
678 .IX Subsection "Recursive inheritance detected earlier"
679 Perl will now immediately throw an exception if you modify any package\*(Aqs
680 \&\f(CW@ISA\fR in such a way that it would cause recursive inheritance.
681 .PP
682 Previously, the exception would not occur until Perl attempted to make
683 use of the recursive inheritance while resolving a method or doing a
684 \&\f(CW\*(C`$foo\->isa($bar)\*(C'\fR lookup.
685 .SS "warnings::enabled and warnings::warnif changed to favor users of modules"
686 .IX Subsection "warnings::enabled and warnings::warnif changed to favor users of modules"
687 The behaviour in 5.10.x favors the person using the module;
688 The behaviour in 5.8.x favors the module writer;
689 .PP
690 Assume the following code:
691 .PP
692 .Vb 5
693 \& main calls Foo::Bar::baz()
694 \& Foo::Bar inherits from Foo::Base
695 \& Foo::Bar::baz() calls Foo::Base::_bazbaz()
696 \& Foo::Base::_bazbaz() calls: warnings::warnif(\*(Aqsubstr\*(Aq, \*(Aqsome warning
697 \&message\*(Aq);
698 .Ve
699 .PP
700 On 5.8.x, the code warns when Foo::Bar contains \f(CW\*(C`use warnings;\*(C'\fR
701 It does not matter if Foo::Base or main have warnings enabled
702 to disable the warning one has to modify Foo::Bar.
703 .PP
704 On 5.10.0 and newer, the code warns when main contains \f(CW\*(C`use warnings;\*(C'\fR
705 It does not matter if Foo::Base or Foo::Bar have warnings enabled
706 to disable the warning one has to modify main.
707 .ie n .SS "Removal of ""package;"" (""package"" without arguments)"
708 .el .SS "Removal of \f(CWpackage;\fP (\f(CWpackage\fP without arguments)"
709 .IX Subsection "Removal of package; (package without arguments)"
710 The \f(CW\*(C`package;\*(C'\fR syntax that would let code switch out of any package (and thus
711 require the use of either lexical or fully\-qualified names) has been removed.
712 Its semantics were never that clear and its implementation even less so. (It
713 was previously deprecated in perl 5.8.0.)
714 .SH "Modules and Pragmata"
715 .IX Header "Modules and Pragmata"
716 .SS "Upgrading individual core modules"
717 .IX Subsection "Upgrading individual core modules"
718 Even more core modules are now also available separately through the
719 CPAN. If you wish to update one of these modules, you don\*(Aqt need to
720 wait for a new perl release. From within the cpan shell, running the
721 \&\*(Aqr\*(Aq command will report on modules with upgrades available. See
722 \&\f(CW\*(C`perldoc CPAN\*(C'\fR for more information.
723 .SS "Pragmata Changes"
724 .IX Subsection "Pragmata Changes"
725 .ie n .IP """feature""" 4
726 .el .IP \f(CWfeature\fR 4
727 .IX Item "feature"
728 The new pragma \f(CW\*(C`feature\*(C'\fR is used to enable new features that might break
729 old code. See "The \f(CW\*(C`feature\*(C'\fR pragma" above.
730 .ie n .IP """mro""" 4
731 .el .IP \f(CWmro\fR 4
732 .IX Item "mro"
733 This new pragma enables to change the algorithm used to resolve inherited
734 methods. See "New Pragma, \f(CW\*(C`mro\*(C'\fR" above.
735 .ie n .IP "Scoping of the ""sort"" pragma" 4
736 .el .IP "Scoping of the \f(CWsort\fR pragma" 4
737 .IX Item "Scoping of the sort pragma"
738 The \f(CW\*(C`sort\*(C'\fR pragma is now lexically scoped. Its effect used to be global.
739 .ie n .IP "Scoping of ""bignum"", ""bigint"", ""bigrat""" 4
740 .el .IP "Scoping of \f(CWbignum\fR, \f(CWbigint\fR, \f(CWbigrat\fR" 4
741 .IX Item "Scoping of bignum, bigint, bigrat"
742 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
743 lexically scoped. (Tels)
744 .ie n .IP """base""" 4
745 .el .IP \f(CWbase\fR 4
746 .IX Item "base"
747 The \f(CW\*(C`base\*(C'\fR pragma now warns if a class tries to inherit from itself.
748 (Curtis "Ovid" Poe)
749 .ie n .IP """strict"" and ""warnings""" 4
750 .el .IP "\f(CWstrict\fR and \f(CWwarnings\fR" 4
751 .IX Item "strict and warnings"
752 \&\f(CW\*(C`strict\*(C'\fR and \f(CW\*(C`warnings\*(C'\fR will now complain loudly if they are loaded via
753 incorrect casing (as in \f(CW\*(C`use Strict;\*(C'\fR). (Johan Vromans)
754 .ie n .IP """version""" 4
755 .el .IP \f(CWversion\fR 4
756 .IX Item "version"
757 The \f(CW\*(C`version\*(C'\fR module provides support for version objects.
758 .ie n .IP """warnings""" 4
759 .el .IP \f(CWwarnings\fR 4
760 .IX Item "warnings"
761 The \f(CW\*(C`warnings\*(C'\fR pragma doesn\*(Aqt load \f(CW\*(C`Carp\*(C'\fR anymore. That means that code
762 that used \f(CW\*(C`Carp\*(C'\fR routines without having loaded it at compile time might
763 need to be adjusted; typically, the following (faulty) code won\*(Aqt work
764 anymore, and will require parentheses to be added after the function name:
765 .Sp
766 .Vb 3
767 \& use warnings;
768 \& require Carp;
769 \& Carp::confess \*(Aqargh\*(Aq;
770 .Ve
771 .ie n .IP """less""" 4
772 .el .IP \f(CWless\fR 4
773 .IX Item "less"
774 \&\f(CW\*(C`less\*(C'\fR now does something useful (or at least it tries to). In fact, it
775 has been turned into a lexical pragma. So, in your modules, you can now
776 test whether your users have requested to use less CPU, or less memory,
777 less magic, or maybe even less fat. See less for more. (Joshua ben
778 Jore)
779 .SS "New modules"
780 .IX Subsection "New modules"
781 .IP \(bu 4
782 \&\f(CW\*(C`encoding::warnings\*(C'\fR, by Audrey Tang, is a module to emit warnings
783 whenever an ASCII character string containing high\-bit bytes is implicitly
784 converted into UTF\-8. It\*(Aqs a lexical pragma since Perl 5.9.4; on older
785 perls, its effect is global.
786 .IP \(bu 4
787 \&\f(CW\*(C`Module::CoreList\*(C'\fR, by Richard Clamp, is a small handy module that tells
788 you what versions of core modules ship with any versions of Perl 5. It
789 comes with a command\-line frontend, \f(CW\*(C`corelist\*(C'\fR.
790 .IP \(bu 4
791 \&\f(CW\*(C`Math::BigInt::FastCalc\*(C'\fR is an XS\-enabled, and thus faster, version of
792 \&\f(CW\*(C`Math::BigInt::Calc\*(C'\fR.
793 .IP \(bu 4
794 \&\f(CW\*(C`Compress::Zlib\*(C'\fR is an interface to the zlib compression library. It
795 comes with a bundled version of zlib, so having a working zlib is not a
796 prerequisite to install it. It\*(Aqs used by \f(CW\*(C`Archive::Tar\*(C'\fR (see below).
797 .IP \(bu 4
798 \&\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.
799 .IP \(bu 4
800 \&\f(CW\*(C`Archive::Tar\*(C'\fR is a module to manipulate \f(CW\*(C`tar\*(C'\fR archives.
801 .IP \(bu 4
802 \&\f(CW\*(C`Digest::SHA\*(C'\fR is a module used to calculate many types of SHA digests,
803 has been included for SHA support in the CPAN module.
804 .IP \(bu 4
805 \&\f(CW\*(C`ExtUtils::CBuilder\*(C'\fR and \f(CW\*(C`ExtUtils::ParseXS\*(C'\fR have been added.
806 .IP \(bu 4
807 \&\f(CW\*(C`Hash::Util::FieldHash\*(C'\fR, by Anno Siegel, has been added. This module
808 provides support for \fIfield hashes\fR: hashes that maintain an association
809 of a reference with a value, in a thread\-safe garbage\-collected way.
810 Such hashes are useful to implement inside\-out objects.
811 .IP \(bu 4
812 \&\f(CW\*(C`Module::Build\*(C'\fR, by Ken Williams, has been added. It\*(Aqs an alternative to
813 \&\f(CW\*(C`ExtUtils::MakeMaker\*(C'\fR to build and install perl modules.
814 .IP \(bu 4
815 \&\f(CW\*(C`Module::Load\*(C'\fR, by Jos Boumans, has been added. It provides a single
816 interface to load Perl modules and \fI.pl\fR files.
817 .IP \(bu 4
818 \&\f(CW\*(C`Module::Loaded\*(C'\fR, by Jos Boumans, has been added. It\*(Aqs used to mark
819 modules as loaded or unloaded.
820 .IP \(bu 4
821 \&\f(CW\*(C`Package::Constants\*(C'\fR, by Jos Boumans, has been added. It\*(Aqs a simple
822 helper to list all constants declared in a given package.
823 .IP \(bu 4
824 \&\f(CW\*(C`Win32API::File\*(C'\fR, by Tye McQueen, has been added (for Windows builds).
825 This module provides low\-level access to Win32 system API calls for
826 files/dirs.
827 .IP \(bu 4
828 \&\f(CW\*(C`Locale::Maketext::Simple\*(C'\fR, needed by CPANPLUS, is a simple wrapper around
829 \&\f(CW\*(C`Locale::Maketext::Lexicon\*(C'\fR. Note that \f(CW\*(C`Locale::Maketext::Lexicon\*(C'\fR isn\*(Aqt
830 included in the perl core; the behaviour of \f(CW\*(C`Locale::Maketext::Simple\*(C'\fR
831 gracefully degrades when the later isn\*(Aqt present.
832 .IP \(bu 4
833 \&\f(CW\*(C`Params::Check\*(C'\fR implements a generic input parsing/checking mechanism. It
834 is used by CPANPLUS.
835 .IP \(bu 4
836 \&\f(CW\*(C`Term::UI\*(C'\fR simplifies the task to ask questions at a terminal prompt.
837 .IP \(bu 4
838 \&\f(CW\*(C`Object::Accessor\*(C'\fR provides an interface to create per\-object accessors.
839 .IP \(bu 4
840 \&\f(CW\*(C`Module::Pluggable\*(C'\fR is a simple framework to create modules that accept
841 pluggable sub\-modules.
842 .IP \(bu 4
843 \&\f(CW\*(C`Module::Load::Conditional\*(C'\fR provides simple ways to query and possibly
844 load installed modules.
845 .IP \(bu 4
846 \&\f(CW\*(C`Time::Piece\*(C'\fR provides an object oriented interface to time functions,
847 overriding the built\-ins \fBlocaltime()\fR and \fBgmtime()\fR.
848 .IP \(bu 4
849 \&\f(CW\*(C`IPC::Cmd\*(C'\fR helps to find and run external commands, possibly
850 interactively.
851 .IP \(bu 4
852 \&\f(CW\*(C`File::Fetch\*(C'\fR provide a simple generic file fetching mechanism.
853 .IP \(bu 4
854 \&\f(CW\*(C`Log::Message\*(C'\fR and \f(CW\*(C`Log::Message::Simple\*(C'\fR are used by the log facility
855 of \f(CW\*(C`CPANPLUS\*(C'\fR.
856 .IP \(bu 4
857 \&\f(CW\*(C`Archive::Extract\*(C'\fR is a generic archive extraction mechanism
858 for \fI.tar\fR (plain, gzipped or bzipped) or \fI.zip\fR files.
859 .IP \(bu 4
860 \&\f(CW\*(C`CPANPLUS\*(C'\fR provides an API and a command\-line tool to access the CPAN
861 mirrors.
862 .IP \(bu 4
863 \&\f(CW\*(C`Pod::Escapes\*(C'\fR provides utilities that are useful in decoding Pod
864 E<...> sequences.
865 .IP \(bu 4
866 \&\f(CW\*(C`Pod::Simple\*(C'\fR is now the backend for several of the Pod\-related modules
867 included with Perl.
868 .SS "Selected Changes to Core Modules"
869 .IX Subsection "Selected Changes to Core Modules"
870 .ie n .IP """Attribute::Handlers""" 4
871 .el .IP \f(CWAttribute::Handlers\fR 4
872 .IX Item "Attribute::Handlers"
873 \&\f(CW\*(C`Attribute::Handlers\*(C'\fR can now report the caller\*(Aqs file and line number.
874 (David Feldman)
875 .Sp
876 All interpreted attributes are now passed as array references. (Damian
877 Conway)
878 .ie n .IP """B::Lint""" 4
879 .el .IP \f(CWB::Lint\fR 4
880 .IX Item "B::Lint"
881 \&\f(CW\*(C`B::Lint\*(C'\fR is now based on \f(CW\*(C`Module::Pluggable\*(C'\fR, and so can be extended
882 with plugins. (Joshua ben Jore)
883 .ie n .IP """B""" 4
884 .el .IP \f(CWB\fR 4
885 .IX Item "B"
886 It\*(Aqs now possible to access the lexical pragma hints (\f(CW\*(C`%^H\*(C'\fR) by using the
887 method \fBB::COP::hints_hash()\fR. It returns a \f(CW\*(C`B::RHE\*(C'\fR object, which in turn
888 can be used to get a hash reference via the method \fBB::RHE::HASH()\fR. (Joshua
889 ben Jore)
890 .ie n .IP """Thread""" 4
891 .el .IP \f(CWThread\fR 4
892 .IX Item "Thread"
893 As the old 5005thread threading model has been removed, in favor of the
894 ithreads scheme, the \f(CW\*(C`Thread\*(C'\fR module is now a compatibility wrapper, to
895 be used in old code only. It has been removed from the default list of
896 dynamic extensions.
897 .SH "Utility Changes"
898 .IX Header "Utility Changes"
899 .IP "perl \-d" 4
900 .IX Item "perl -d"
901 The Perl debugger can now save all debugger commands for sourcing later;
902 notably, it can now emulate stepping backwards, by restarting and
903 rerunning all bar the last command from a saved command history.
904 .Sp
905 It can also display the parent inheritance tree of a given class, with the
906 \&\f(CW\*(C`i\*(C'\fR command.
907 .IP ptar 4
908 .IX Item "ptar"
909 \&\f(CW\*(C`ptar\*(C'\fR is a pure perl implementation of \f(CW\*(C`tar\*(C'\fR that comes with
910 \&\f(CW\*(C`Archive::Tar\*(C'\fR.
911 .IP ptardiff 4
912 .IX Item "ptardiff"
913 \&\f(CW\*(C`ptardiff\*(C'\fR is a small utility used to generate a diff between the contents
914 of a tar archive and a directory tree. Like \f(CW\*(C`ptar\*(C'\fR, it comes with
915 \&\f(CW\*(C`Archive::Tar\*(C'\fR.
916 .IP shasum 4
917 .IX Item "shasum"
918 \&\f(CW\*(C`shasum\*(C'\fR is a command\-line utility, used to print or to check SHA
919 digests. It comes with the new \f(CW\*(C`Digest::SHA\*(C'\fR module.
920 .IP corelist 4
921 .IX Item "corelist"
922 The \f(CW\*(C`corelist\*(C'\fR utility is now installed with perl (see "New modules"
923 above).
924 .IP "h2ph and h2xs" 4
925 .IX Item "h2ph and h2xs"
926 \&\f(CW\*(C`h2ph\*(C'\fR and \f(CW\*(C`h2xs\*(C'\fR have been made more robust with regard to
927 "modern" C code.
928 .Sp
929 \&\f(CW\*(C`h2xs\*(C'\fR implements a new option \f(CW\*(C`\-\-use\-xsloader\*(C'\fR to force use of
930 \&\f(CW\*(C`XSLoader\*(C'\fR even in backwards compatible modules.
931 .Sp
932 The handling of authors\*(Aq names that had apostrophes has been fixed.
933 .Sp
934 Any enums with negative values are now skipped.
935 .IP perlivp 4
936 .IX Item "perlivp"
937 \&\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
938 option to run \fIall\fR tests.
939 .IP find2perl 4
940 .IX Item "find2perl"
941 \&\f(CW\*(C`find2perl\*(C'\fR now assumes \f(CW\*(C`\-print\*(C'\fR as a default action. Previously, it
942 needed to be specified explicitly.
943 .Sp
944 Several bugs have been fixed in \f(CW\*(C`find2perl\*(C'\fR, regarding \f(CW\*(C`\-exec\*(C'\fR and
945 \&\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
946 added.
947 .IP config_data 4
948 .IX Item "config_data"
949 \&\f(CW\*(C`config_data\*(C'\fR is a new utility that comes with \f(CW\*(C`Module::Build\*(C'\fR. It
950 provides a command\-line interface to the configuration of Perl modules
951 that use Module::Build\*(Aqs framework of configurability (that is,
952 \&\f(CW*::ConfigData\fR modules that contain local configuration information for
953 their parent modules.)
954 .IP cpanp 4
955 .IX Item "cpanp"
956 \&\f(CW\*(C`cpanp\*(C'\fR, the CPANPLUS shell, has been added. (\f(CW\*(C`cpanp\-run\-perl\*(C'\fR, a
957 helper for CPANPLUS operation, has been added too, but isn\*(Aqt intended for
958 direct use).
959 .IP cpan2dist 4
960 .IX Item "cpan2dist"
961 \&\f(CW\*(C`cpan2dist\*(C'\fR is a new utility that comes with CPANPLUS. It\*(Aqs a tool to
962 create distributions (or packages) from CPAN modules.
963 .IP pod2html 4
964 .IX Item "pod2html"
965 The output of \f(CW\*(C`pod2html\*(C'\fR has been enhanced to be more customizable via
966 CSS. Some formatting problems were also corrected. (Jari Aalto)
967 .SH "New Documentation"
968 .IX Header "New Documentation"
969 The perlpragma manpage documents how to write one\*(Aqs own lexical
970 pragmas in pure Perl (something that is possible starting with 5.9.4).
971 .PP
972 The new perlglossary manpage is a glossary of terms used in the Perl
973 documentation, technical and otherwise, kindly provided by O\*(AqReilly Media,
974 Inc.
975 .PP
976 The perlreguts manpage, courtesy of Yves Orton, describes internals of the
977 Perl regular expression engine.
978 .PP
979 The perlreapi manpage describes the interface to the perl interpreter
980 used to write pluggable regular expression engines (by Ævar Arnfjörð
981 Bjarmason).
982 .PP
983 The perlunitut manpage is a tutorial for programming with Unicode and
984 string encodings in Perl, courtesy of Juerd Waalboer.
985 .PP
986 A new manual page, perlunifaq (the Perl Unicode FAQ), has been added
987 (Juerd Waalboer).
988 .PP
989 The perlcommunity manpage gives a description of the Perl community
990 on the Internet and in real life. (Edgar "Trizor" Bering)
991 .PP
992 The CORE manual page documents the \f(CW\*(C`CORE::\*(C'\fR namespace. (Tels)
993 .PP
994 The long\-existing feature of \f(CW\*(C`/(?{...})/\*(C'\fR regexps setting \f(CW$_\fR and \fBpos()\fR
995 is now documented.
996 .SH "Performance Enhancements"
997 .IX Header "Performance Enhancements"
998 .SS "In\-place sorting"
999 .IX Subsection "In-place sorting"
1000 Sorting arrays in place (\f(CW\*(C`@a = sort @a\*(C'\fR) is now optimized to avoid
1001 making a temporary copy of the array.
1002 .PP
1003 Likewise, \f(CW\*(C`reverse sort ...\*(C'\fR is now optimized to sort in reverse,
1004 avoiding the generation of a temporary intermediate list.
1005 .SS "Lexical array access"
1006 .IX Subsection "Lexical array access"
1007 Access to elements of lexical arrays via a numeric constant between 0 and
1008 255 is now faster. (This used to be only the case for global arrays.)
1009 .SS "XS\-assisted SWASHGET"
1010 .IX Subsection "XS-assisted SWASHGET"
1011 Some pure\-perl code that perl was using to retrieve Unicode properties and
1012 transliteration mappings has been reimplemented in XS.
1013 .SS "Constant subroutines"
1014 .IX Subsection "Constant subroutines"
1015 The interpreter internals now support a far more memory efficient form of
1016 inlineable constants. Storing a reference to a constant value in a symbol
1017 table is equivalent to a full typeglob referencing a constant subroutine,
1018 but using about 400 bytes less memory. This proxy constant subroutine is
1019 automatically upgraded to a real typeglob with subroutine if necessary.
1020 The approach taken is analogous to the existing space optimisation for
1021 subroutine stub declarations, which are stored as plain scalars in place
1022 of the full typeglob.
1023 .PP
1024 Several of the core modules have been converted to use this feature for
1025 their system dependent constants \- as a result \f(CW\*(C`use POSIX;\*(C'\fR now takes about
1026 200K less memory.
1027 .ie n .SS """PERL_DONT_CREATE_GVSV"""
1028 .el .SS \f(CWPERL_DONT_CREATE_GVSV\fP
1029 .IX Subsection "PERL_DONT_CREATE_GVSV"
1030 The new compilation flag \f(CW\*(C`PERL_DONT_CREATE_GVSV\*(C'\fR, introduced as an option
1031 in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl
1032 from creating an empty scalar with every new typeglob. See perl589delta
1033 for details.
1034 .SS "Weak references are cheaper"
1035 .IX Subsection "Weak references are cheaper"
1036 Weak reference creation is now \fIO(1)\fR rather than \fIO(n)\fR, courtesy of
1037 Nicholas Clark. Weak reference deletion remains \fIO(n)\fR, but if deletion only
1038 happens at program exit, it may be skipped completely.
1039 .SS "\fBsort()\fP enhancements"
1040 .IX Subsection "sort() enhancements"
1041 Salvador Fandiño provided improvements to reduce the memory usage of \f(CW\*(C`sort\*(C'\fR
1042 and to speed up some cases.
1043 .SS "Memory optimisations"
1044 .IX Subsection "Memory optimisations"
1045 Several internal data structures (typeglobs, GVs, CVs, formats) have been
1046 restructured to use less memory. (Nicholas Clark)
1047 .SS "UTF\-8 cache optimisation"
1048 .IX Subsection "UTF-8 cache optimisation"
1049 The UTF\-8 caching code is now more efficient, and used more often.
1050 (Nicholas Clark)
1051 .SS "Sloppy stat on Windows"
1052 .IX Subsection "Sloppy stat on Windows"
1053 On Windows, perl\*(Aqs \fBstat()\fR function normally opens the file to determine
1054 the link count and update attributes that may have been changed through
1055 hard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds up
1056 \&\fBstat()\fR by not performing this operation. (Jan Dubois)
1057 .SS "Regular expressions optimisations"
1058 .IX Subsection "Regular expressions optimisations"
1059 .IP "Engine de\-recursivised" 4
1060 .IX Item "Engine de-recursivised"
1061 The regular expression engine is no longer recursive, meaning that
1062 patterns that used to overflow the stack will either die with useful
1063 explanations, or run to completion, which, since they were able to blow
1064 the stack before, will likely take a very long time to happen. If you were
1065 experiencing the occasional stack overflow (or segfault) and upgrade to
1066 discover that now perl apparently hangs instead, look for a degenerate
1067 regex. (Dave Mitchell)
1068 .IP "Single char char\-classes treated as literals" 4
1069 .IX Item "Single char char-classes treated as literals"
1070 Classes of a single character are now treated the same as if the character
1071 had been used as a literal, meaning that code that uses char\-classes as an
1072 escaping mechanism will see a speedup. (Yves Orton)
1073 .IP "Trie optimisation of literal string alternations" 4
1074 .IX Item "Trie optimisation of literal string alternations"
1075 Alternations, where possible, are optimised into more efficient matching
1076 structures. String literal alternations are merged into a trie and are
1077 matched simultaneously. This means that instead of O(N) time for matching
1078 N alternations at a given point, the new code performs in O(1) time.
1079 A new special variable, ${^RE_TRIE_MAXBUF}, has been added to fine\-tune
1080 this optimization. (Yves Orton)
1081 .Sp
1082 \&\fBNote:\fR Much code exists that works around perl\*(Aqs historic poor
1083 performance on alternations. Often the tricks used to do so will disable
1084 the new optimisations. Hopefully the utility modules used for this purpose
1085 will be educated about these new optimisations.
1086 .IP "Aho\-Corasick start\-point optimisation" 4
1087 .IX Item "Aho-Corasick start-point optimisation"
1088 When a pattern starts with a trie\-able alternation and there aren\*(Aqt
1089 better optimisations available, the regex engine will use Aho\-Corasick
1090 matching to find the start point. (Yves Orton)
1091 .SH "Installation and Configuration Improvements"
1092 .IX Header "Installation and Configuration Improvements"
1093 .SS "Configuration improvements"
1094 .IX Subsection "Configuration improvements"
1095 .ie n .IP """\-Dusesitecustomize""" 4
1096 .el .IP \f(CW\-Dusesitecustomize\fR 4
1097 .IX Item "-Dusesitecustomize"
1098 Run\-time customization of \f(CW@INC\fR can be enabled by passing the
1099 \&\f(CW\*(C`\-Dusesitecustomize\*(C'\fR flag to Configure. When enabled, this will make perl
1100 run \fR\f(CI$sitelibexp\fR\fI/sitecustomize.pl\fR before anything else. This script can
1101 then be set up to add additional entries to \f(CW@INC\fR.
1102 .IP "Relocatable installations" 4
1103 .IX Item "Relocatable installations"
1104 There is now Configure support for creating a relocatable perl tree. If
1105 you Configure with \f(CW\*(C`\-Duserelocatableinc\*(C'\fR, then the paths in \f(CW@INC\fR (and
1106 everything else in \f(CW%Config\fR) can be optionally located via the path of the
1107 perl executable.
1108 .Sp
1109 That means that, if the string \f(CW".../"\fR is found at the start of any
1110 path, it\*(Aqs substituted with the directory of $^X. So, the relocation can
1111 be configured on a per\-directory basis, although the default with
1112 \&\f(CW\*(C`\-Duserelocatableinc\*(C'\fR is that everything is relocated. The initial
1113 install is done to the original configured prefix.
1114 .IP "\fBstrlcat()\fR and \fBstrlcpy()\fR" 4
1115 .IX Item "strlcat() and strlcpy()"
1116 The configuration process now detects whether \fBstrlcat()\fR and \fBstrlcpy()\fR are
1117 available. When they are not available, perl\*(Aqs own version is used (from
1118 Russ Allbery\*(Aqs public domain implementation). Various places in the perl
1119 interpreter now use them. (Steve Peters)
1120 .ie n .IP """d_pseudofork"" and ""d_printf_format_null""" 4
1121 .el .IP "\f(CWd_pseudofork\fR and \f(CWd_printf_format_null\fR" 4
1122 .IX Item "d_pseudofork and d_printf_format_null"
1123 A new configuration variable, available as \f(CW$Config{d_pseudofork}\fR in
1124 the Config module, has been added, to distinguish real \fBfork()\fR support
1125 from fake pseudofork used on Windows platforms.
1126 .Sp
1127 A new configuration variable, \f(CW\*(C`d_printf_format_null\*(C'\fR, has been added,
1128 to see if printf\-like formats are allowed to be NULL.
1129 .IP "Configure help" 4
1130 .IX Item "Configure help"
1131 \&\f(CW\*(C`Configure \-h\*(C'\fR has been extended with the most commonly used options.
1132 .SS "Compilation improvements"
1133 .IX Subsection "Compilation improvements"
1134 .IP "Parallel build" 4
1135 .IX Item "Parallel build"
1136 Parallel makes should work properly now, although there may still be problems
1137 if \f(CW\*(C`make test\*(C'\fR is instructed to run in parallel.
1138 .IP "Borland\*(Aqs compilers support" 4
1139 .IX Item "Borland's compilers support"
1140 Building with Borland\*(Aqs compilers on Win32 should work more smoothly. In
1141 particular Steve Hay has worked to side step many warnings emitted by their
1142 compilers and at least one C compiler internal error.
1143 .IP "Static build on Windows" 4
1144 .IX Item "Static build on Windows"
1145 Perl extensions on Windows now can be statically built into the Perl DLL.
1146 .Sp
1147 Also, it\*(Aqs now possible to build a \f(CW\*(C`perl\-static.exe\*(C'\fR that doesn\*(Aqt depend
1148 on the Perl DLL on Win32. See the Win32 makefiles for details.
1149 (Vadim Konovalov)
1150 .IP "ppport.h files" 4
1151 .IX Item "ppport.h files"
1152 All \fIppport.h\fR files in the XS modules bundled with perl are now
1153 autogenerated at build time. (Marcus Holland\-Moritz)
1154 .IP "C++ compatibility" 4
1155 .IX Item "C++ compatibility"
1156 Efforts have been made to make perl and the core XS modules compilable
1157 with various C++ compilers (although the situation is not perfect with
1158 some of the compilers on some of the platforms tested.)
1159 .IP "Support for Microsoft 64\-bit compiler" 4
1160 .IX Item "Support for Microsoft 64-bit compiler"
1161 Support for building perl with Microsoft\*(Aqs 64\-bit compiler has been
1162 improved. (ActiveState)
1163 .IP "Visual C++" 4
1164 .IX Item "Visual C++"
1165 Perl can now be compiled with Microsoft Visual C++ 2005 (and 2008 Beta 2).
1166 .IP "Win32 builds" 4
1167 .IX Item "Win32 builds"
1168 All win32 builds (MS\-Win, WinCE) have been merged and cleaned up.
1169 .SS "Installation improvements"
1170 .IX Subsection "Installation improvements"
1171 .IP "Module auxiliary files" 4
1172 .IX Item "Module auxiliary files"
1173 README files and changelogs for CPAN modules bundled with perl are no
1174 longer installed.
1175 .SS "New Or Improved Platforms"
1176 .IX Subsection "New Or Improved Platforms"
1177 Perl has been reported to work on Symbian OS. See perlsymbian for more
1178 information.
1179 .PP
1180 Many improvements have been made towards making Perl work correctly on
1181 z/OS.
1182 .PP
1183 Perl has been reported to work on DragonFlyBSD and MidnightBSD.
1184 .PP
1185 Perl has also been reported to work on NexentaOS
1186 ( http://www.gnusolaris.org/ ).
1187 .PP
1188 The VMS port has been improved. See perlvms.
1189 .PP
1190 Support for Cray XT4 Catamount/Qk has been added. See
1191 \&\fIhints/catamount.sh\fR in the source code distribution for more
1192 information.
1193 .PP
1194 Vendor patches have been merged for RedHat and Gentoo.
1195 .PP
1196 \&\fBDynaLoader::dl_unload_file()\fR now works on Windows.
1197 .SH "Selected Bug Fixes"
1198 .IX Header "Selected Bug Fixes"
1199 .IP "strictures in regexp\-eval blocks" 4
1200 .IX Item "strictures in regexp-eval blocks"
1201 \&\f(CW\*(C`strict\*(C'\fR wasn\*(Aqt in effect in regexp\-eval blocks (\f(CW\*(C`/(?{...})/\*(C'\fR).
1202 .IP "Calling \fBCORE::require()\fR" 4
1203 .IX Item "Calling CORE::require()"
1204 \&\fBCORE::require()\fR and \fBCORE::do()\fR were always parsed as \fBrequire()\fR and \fBdo()\fR
1205 when they were overridden. This is now fixed.
1206 .IP "Subscripts of slices" 4
1207 .IX Item "Subscripts of slices"
1208 You can now use a non\-arrowed form for chained subscripts after a list
1209 slice, like in:
1210 .Sp
1211 .Vb 1
1212 \& ({foo => "bar"})[0]{foo}
1213 .Ve
1214 .Sp
1215 This used to be a syntax error; a \f(CW\*(C`\->\*(C'\fR was required.
1216 .ie n .IP """no warnings \*(Aqcategory\*(Aq"" works correctly with \-w" 4
1217 .el .IP "\f(CWno warnings \*(Aqcategory\*(Aq\fR works correctly with \-w" 4
1218 .IX Item "no warnings 'category' works correctly with -w"
1219 Previously when running with warnings enabled globally via \f(CW\*(C`\-w\*(C'\fR, selective
1220 disabling of specific warning categories would actually turn off all warnings.
1221 This is now fixed; now \f(CW\*(C`no warnings \*(Aqio\*(Aq;\*(C'\fR will only turn off warnings in the
1222 \&\f(CW\*(C`io\*(C'\fR class. Previously it would erroneously turn off all warnings.
1223 .IP "threads improvements" 4
1224 .IX Item "threads improvements"
1225 Several memory leaks in ithreads were closed. Also, ithreads were made
1226 less memory\-intensive.
1227 .Sp
1228 \&\f(CW\*(C`threads\*(C'\fR is now a dual\-life module, also available on CPAN. It has been
1229 expanded in many ways. A \fBkill()\fR method is available for thread signalling.
1230 One can get thread status, or the list of running or joinable threads.
1231 .Sp
1232 A new \f(CW\*(C`threads\->exit()\*(C'\fR method is used to exit from the application
1233 (this is the default for the main thread) or from the current thread only
1234 (this is the default for all other threads). On the other hand, the \fBexit()\fR
1235 built\-in now always causes the whole application to terminate. (Jerry
1236 D. Hedden)
1237 .IP "\fBchr()\fR and negative values" 4
1238 .IX Item "chr() and negative values"
1239 \&\fBchr()\fR on a negative value now gives \f(CW\*(C`\ex{FFFD}\*(C'\fR, the Unicode replacement
1240 character, unless when the \f(CW\*(C`bytes\*(C'\fR pragma is in effect, where the low
1241 eight bits of the value are used.
1242 .IP "PERL5SHELL and tainting" 4
1243 .IX Item "PERL5SHELL and tainting"
1244 On Windows, the PERL5SHELL environment variable is now checked for
1245 taintedness. (Rafael Garcia\-Suarez)
1246 .IP "Using *FILE{IO}" 4
1247 .IX Item "Using *FILE{IO}"
1248 \&\f(CWstat()\fR and \f(CW\*(C`\-X\*(C'\fR filetests now treat *FILE{IO} filehandles like *FILE
1249 filehandles. (Steve Peters)
1250 .IP "Overloading and reblessing" 4
1251 .IX Item "Overloading and reblessing"
1252 Overloading now works when references are reblessed into another class.
1253 Internally, this has been implemented by moving the flag for "overloading"
1254 from the reference to the referent, which logically is where it should
1255 always have been. (Nicholas Clark)
1256 .IP "Overloading and UTF\-8" 4
1257 .IX Item "Overloading and UTF-8"
1258 A few bugs related to UTF\-8 handling with objects that have
1259 stringification overloaded have been fixed. (Nicholas Clark)
1260 .IP "eval memory leaks fixed" 4
1261 .IX Item "eval memory leaks fixed"
1262 Traditionally, \f(CW\*(C`eval \*(Aqsyntax error\*(Aq\*(C'\fR has leaked badly. Many (but not all)
1263 of these leaks have now been eliminated or reduced. (Dave Mitchell)
1264 .IP "Random device on Windows" 4
1265 .IX Item "Random device on Windows"
1266 In previous versions, perl would read the file \fI/dev/urandom\fR if it
1267 existed when seeding its random number generator. That file is unlikely
1268 to exist on Windows, and if it did would probably not contain appropriate
1269 data, so perl no longer tries to read it on Windows. (Alex Davies)
1270 .IP PERLIO_DEBUG 4
1271 .IX Item "PERLIO_DEBUG"
1272 The \f(CW\*(C`PERLIO_DEBUG\*(C'\fR environment variable no longer has any effect for
1273 setuid scripts and for scripts run with \fB\-T\fR.
1274 .Sp
1275 Moreover, with a thread\-enabled perl, using \f(CW\*(C`PERLIO_DEBUG\*(C'\fR could lead to
1276 an internal buffer overflow. This has been fixed.
1277 .IP "PerlIO::scalar and read\-only scalars" 4
1278 .IX Item "PerlIO::scalar and read-only scalars"
1279 PerlIO::scalar will now prevent writing to read\-only scalars. Moreover,
1280 \&\fBseek()\fR is now supported with PerlIO::scalar\-based filehandles, the
1281 underlying string being zero\-filled as needed. (Rafael, Jarkko Hietaniemi)
1282 .IP "\fBstudy()\fR and UTF\-8" 4
1283 .IX Item "study() and UTF-8"
1284 \&\fBstudy()\fR never worked for UTF\-8 strings, but could lead to false results.
1285 It\*(Aqs now a no\-op on UTF\-8 data. (Yves Orton)
1286 .IP "Critical signals" 4
1287 .IX Item "Critical signals"
1288 The signals SIGILL, SIGBUS and SIGSEGV are now always delivered in an
1289 "unsafe" manner (contrary to other signals, that are deferred until the
1290 perl interpreter reaches a reasonably stable state; see
1291 "Deferred Signals (Safe Signals)" in perlipc). (Rafael)
1292 .ie n .IP "@INC\-hook fix" 4
1293 .el .IP "\f(CW@INC\fR\-hook fix" 4
1294 .IX Item "@INC-hook fix"
1295 When a module or a file is loaded through an \f(CW@INC\fR\-hook, and when this hook
1296 has set a filename entry in \f(CW%INC\fR, _\|_FILE_\|_ is now set for this module
1297 accordingly to the contents of that \f(CW%INC\fR entry. (Rafael)
1298 .ie n .IP """\-t"" switch fix" 4
1299 .el .IP "\f(CW\-t\fR switch fix" 4
1300 .IX Item "-t switch fix"
1301 The \f(CW\*(C`\-w\*(C'\fR and \f(CW\*(C`\-t\*(C'\fR switches can now be used together without messing
1302 up which categories of warnings are activated. (Rafael)
1303 .IP "Duping UTF\-8 filehandles" 4
1304 .IX Item "Duping UTF-8 filehandles"
1305 Duping a filehandle which has the \f(CW\*(C`:utf8\*(C'\fR PerlIO layer set will now
1306 properly carry that layer on the duped filehandle. (Rafael)
1307 .IP "Localisation of hash elements" 4
1308 .IX Item "Localisation of hash elements"
1309 Localizing a hash element whose key was given as a variable didn\*(Aqt work
1310 correctly if the variable was changed while the \fBlocal()\fR was in effect (as
1311 in \f(CW\*(C`local $h{$x}; ++$x\*(C'\fR). (Bo Lindbergh)
1312 .SH "New or Changed Diagnostics"
1313 .IX Header "New or Changed Diagnostics"
1314 .IP "Use of uninitialized value" 4
1315 .IX Item "Use of uninitialized value"
1316 Perl will now try to tell you the name of the variable (if any) that was
1317 undefined.
1318 .IP "Deprecated use of \fBmy()\fR in false conditional" 4
1319 .IX Item "Deprecated use of my() in false conditional"
1320 A new deprecation warning, \fIDeprecated use of \fR\f(BImy()\fR\fI in false conditional\fR,
1321 has been added, to warn against the use of the dubious and deprecated
1322 construct
1323 .Sp
1324 .Vb 1
1325 \& my $x if 0;
1326 .Ve
1327 .Sp
1328 See perldiag. Use \f(CW\*(C`state\*(C'\fR variables instead.
1329 .IP "!=~ should be !~" 4
1330 .IX Item "!=~ should be !~"
1331 A new warning, \f(CW\*(C`!=~ should be !~\*(C'\fR, is emitted to prevent this misspelling
1332 of the non\-matching operator.
1333 .IP "Newline in left\-justified string" 4
1334 .IX Item "Newline in left-justified string"
1335 The warning \fINewline in left\-justified string\fR has been removed.
1336 .IP "Too late for ""\-T"" option" 4
1337 .IX Item "Too late for ""-T"" option"
1338 The error \fIToo late for "\-T" option\fR has been reformulated to be more
1339 descriptive.
1340 .ie n .IP """%s"" variable %s masks earlier declaration" 4
1341 .el .IP """%s"" variable \f(CW%s\fR masks earlier declaration" 4
1342 .IX Item """%s"" variable %s masks earlier declaration"
1343 This warning is now emitted in more consistent cases; in short, when one
1344 of the declarations involved is a \f(CW\*(C`my\*(C'\fR variable:
1345 .Sp
1346 .Vb 3
1347 \& my $x; my $x; # warns
1348 \& my $x; our $x; # warns
1349 \& our $x; my $x; # warns
1350 .Ve
1351 .Sp
1352 On the other hand, the following:
1353 .Sp
1354 .Vb 1
1355 \& our $x; our $x;
1356 .Ve
1357 .Sp
1358 now gives a \f(CW\*(C`"our" variable %s redeclared\*(C'\fR warning.
1359 .IP "\fBreaddir()\fR/\fBclosedir()\fR/etc. attempted on invalid dirhandle" 4
1360 .IX Item "readdir()/closedir()/etc. attempted on invalid dirhandle"
1361 These new warnings are now emitted when a dirhandle is used but is
1362 either closed or not really a dirhandle.
1363 .ie n .IP "Opening dirhandle/filehandle %s also as a file/directory" 4
1364 .el .IP "Opening dirhandle/filehandle \f(CW%s\fR also as a file/directory" 4
1365 .IX Item "Opening dirhandle/filehandle %s also as a file/directory"
1366 Two deprecation warnings have been added: (Rafael)
1367 .Sp
1368 .Vb 2
1369 \& Opening dirhandle %s also as a file
1370 \& Opening filehandle %s also as a directory
1371 .Ve
1372 .IP "Use of \-P is deprecated" 4
1373 .IX Item "Use of -P is deprecated"
1374 Perl\*(Aqs command\-line switch \f(CW\*(C`\-P\*(C'\fR is now deprecated.
1375 .IP "v\-string in use/require is non\-portable" 4
1376 .IX Item "v-string in use/require is non-portable"
1377 Perl will warn you against potential backwards compatibility problems with
1378 the \f(CW\*(C`use VERSION\*(C'\fR syntax.
1379 .IP "perl \-V" 4
1380 .IX Item "perl -V"
1381 \&\f(CW\*(C`perl \-V\*(C'\fR has several improvements, making it more useable from shell
1382 scripts to get the value of configuration variables. See perlrun for
1383 details.
1384 .SH "Changed Internals"
1385 .IX Header "Changed Internals"
1386 In general, the source code of perl has been refactored, tidied up,
1387 and optimized in many places. Also, memory management and allocation
1388 has been improved in several points.
1389 .PP
1390 When compiling the perl core with gcc, as many gcc warning flags are
1391 turned on as is possible on the platform. (This quest for cleanliness
1392 doesn\*(Aqt extend to XS code because we cannot guarantee the tidiness of
1393 code we didn\*(Aqt write.) Similar strictness flags have been added or
1394 tightened for various other C compilers.
1395 .SS "Reordering of SVt_* constants"
1396 .IX Subsection "Reordering of SVt_* constants"
1397 The relative ordering of constants that define the various types of \f(CW\*(C`SV\*(C'\fR
1398 have changed; in particular, \f(CW\*(C`SVt_PVGV\*(C'\fR has been moved before \f(CW\*(C`SVt_PVLV\*(C'\fR,
1399 \&\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
1400 difference unless you have code that explicitly makes assumptions about that
1401 ordering. (The inheritance hierarchy of \f(CW\*(C`B::*\*(C'\fR objects has been changed
1402 to reflect this.)
1403 .SS "Elimination of SVt_PVBM"
1404 .IX Subsection "Elimination of SVt_PVBM"
1405 Related to this, the internal type \f(CW\*(C`SVt_PVBM\*(C'\fR has been removed. This
1406 dedicated type of \f(CW\*(C`SV\*(C'\fR was used by the \f(CW\*(C`index\*(C'\fR operator and parts of the
1407 regexp engine to facilitate fast Boyer\-Moore matches. Its use internally has
1408 been replaced by \f(CW\*(C`SV\*(C'\fRs of type \f(CW\*(C`SVt_PVGV\*(C'\fR.
1409 .SS "New type SVt_BIND"
1410 .IX Subsection "New type SVt_BIND"
1411 A new type \f(CW\*(C`SVt_BIND\*(C'\fR has been added, in readiness for the project to
1412 implement Perl 6 on 5. There deliberately is no implementation yet, and
1413 they cannot yet be created or destroyed.
1414 .SS "Removal of CPP symbols"
1415 .IX Subsection "Removal of CPP symbols"
1416 The C preprocessor symbols \f(CW\*(C`PERL_PM_APIVERSION\*(C'\fR and
1417 \&\f(CW\*(C`PERL_XS_APIVERSION\*(C'\fR, which were supposed to give the version number of
1418 the oldest perl binary\-compatible (resp. source\-compatible) with the
1419 present one, were not used, and sometimes had misleading values. They have
1420 been removed.
1421 .SS "Less space is used by ops"
1422 .IX Subsection "Less space is used by ops"
1423 The \f(CW\*(C`BASEOP\*(C'\fR structure now uses less space. The \f(CW\*(C`op_seq\*(C'\fR field has been
1424 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
1425 bits long. (Consequently, the \f(CW\*(C`B::OP\*(C'\fR class doesn\*(Aqt provide an \f(CW\*(C`seq\*(C'\fR
1426 method anymore.)
1427 .SS "New parser"
1428 .IX Subsection "New parser"
1429 perl\*(Aqs parser is now generated by bison (it used to be generated by
1430 byacc.) As a result, it seems to be a bit more robust.
1431 .PP
1432 Also, Dave Mitchell improved the lexer debugging output under \f(CW\*(C`\-DT\*(C'\fR.
1433 .ie n .SS "Use of ""const"""
1434 .el .SS "Use of \f(CWconst\fP"
1435 .IX Subsection "Use of const"
1436 Andy Lester supplied many improvements to determine which function
1437 parameters and local variables could actually be declared \f(CW\*(C`const\*(C'\fR to the C
1438 compiler. Steve Peters provided new \f(CW*_set\fR macros and reworked the core to
1439 use these rather than assigning to macros in LVALUE context.
1440 .SS Mathoms
1441 .IX Subsection "Mathoms"
1442 A new file, \fImathoms.c\fR, has been added. It contains functions that are
1443 no longer used in the perl core, but that remain available for binary or
1444 source compatibility reasons. However, those functions will not be
1445 compiled in if you add \f(CW\*(C`\-DNO_MATHOMS\*(C'\fR in the compiler flags.
1446 .ie n .SS """AvFLAGS"" has been removed"
1447 .el .SS "\f(CWAvFLAGS\fP has been removed"
1448 .IX Subsection "AvFLAGS has been removed"
1449 The \f(CW\*(C`AvFLAGS\*(C'\fR macro has been removed.
1450 .ie n .SS """av_*"" changes"
1451 .el .SS "\f(CWav_*\fP changes"
1452 .IX Subsection "av_* changes"
1453 The \f(CW\*(C`av_*()\*(C'\fR functions, used to manipulate arrays, no longer accept null
1454 \&\f(CW\*(C`AV*\*(C'\fR parameters.
1455 .SS "$^H and %^H"
1456 .IX Subsection "$^H and %^H"
1457 The implementation of the special variables $^H and %^H has changed, to
1458 allow implementing lexical pragmas in pure Perl.
1459 .SS "B:: modules inheritance changed"
1460 .IX Subsection "B:: modules inheritance changed"
1461 The inheritance hierarchy of \f(CW\*(C`B::\*(C'\fR modules has changed; \f(CW\*(C`B::NV\*(C'\fR now
1462 inherits from \f(CW\*(C`B::SV\*(C'\fR (it used to inherit from \f(CW\*(C`B::IV\*(C'\fR).
1463 .SS "Anonymous hash and array constructors"
1464 .IX Subsection "Anonymous hash and array constructors"
1465 The anonymous hash and array constructors now take 1 op in the optree
1466 instead of 3, now that pp_anonhash and pp_anonlist return a reference to
1467 a hash/array when the op is flagged with OPf_SPECIAL. (Nicholas Clark)
1468 .SH "Known Problems"
1469 .IX Header "Known Problems"
1470 There\*(Aqs still a remaining problem in the implementation of the lexical
1471 \&\f(CW$_\fR: it doesn\*(Aqt work inside \f(CW\*(C`/(?{...})/\*(C'\fR blocks. (See the TODO test in
1472 \&\fIt/op/mydef.t\fR.)
1473 .PP
1474 Stacked filetest operators won\*(Aqt work when the \f(CW\*(C`filetest\*(C'\fR pragma is in
1475 effect, because they rely on the \fBstat()\fR buffer \f(CW\*(C`_\*(C'\fR being populated, and
1476 filetest bypasses \fBstat()\fR.
1477 .SS "UTF\-8 problems"
1478 .IX Subsection "UTF-8 problems"
1479 The handling of Unicode still is unclean in several places, where it\*(Aqs
1480 dependent on whether a string is internally flagged as UTF\-8. This will
1481 be made more consistent in perl 5.12, but that won\*(Aqt be possible without
1482 a certain amount of backwards incompatibility.
1483 .SH "Platform Specific Problems"
1484 .IX Header "Platform Specific Problems"
1485 When compiled with g++ and thread support on Linux, it\*(Aqs reported that the
1486 \&\f(CW$!\fR stops working correctly. This is related to the fact that the glibc
1487 provides two \fBstrerror_r\fR\|(3) implementation, and perl selects the wrong
1488 one.
1489 .SH "Reporting Bugs"
1490 .IX Header "Reporting Bugs"
1491 If you find what you think is a bug, you might check the articles
1492 recently posted to the comp.lang.perl.misc newsgroup and the perl
1493 bug database at http://rt.perl.org/rt3/ . There may also be
1494 information at http://www.perl.org/ , the Perl Home Page.
1495 .PP
1496 If you believe you have an unreported bug, please run the \fBperlbug\fR
1497 program included with your release. Be sure to trim your bug down
1498 to a tiny but sufficient test case. Your bug report, along with the
1499 output of \f(CW\*(C`perl \-V\*(C'\fR, will be sent off to [email protected] to be
1500 analysed by the Perl porting team.
1501 .SH "SEE ALSO"
1502 .IX Header "SEE ALSO"
1503 The \fIChanges\fR file and the perl590delta to perl595delta man pages for
1504 exhaustive details on what changed.
1505 .PP
1506 The \fIINSTALL\fR file for how to build Perl.
1507 .PP
1508 The \fIREADME\fR file for general stuff.
1509 .PP
1510 The \fIArtistic\fR and \fICopying\fR files for copyright information.