Debian Codegraph @

upstream/debian-unstable/man1/perl5100delta.1

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