a11a65277d540e84c8d06dcad781a1036e6f0198
[p5sagit/p5-mst-13.2.git] / pod / perl5100delta.pod
1 TODO: perl591delta and further
2
3 =head1 NAME
4
5 perldelta - what is new for perl 5.10.0
6
7 =head1 DESCRIPTION
8
9 This document describes the differences between the 5.8.8 release and
10 the 5.10.0 release.
11
12 Many of the bug fixes in 5.10.0 were already seen in the 5.8.X maintenance
13 releases; they are not duplicated here and are documented in the set of
14 man pages named perl58[1-8]?delta.
15
16 =head1 Incompatible Changes
17
18 =head2 Packing and UTF-8 strings
19
20 =for XXX update this
21
22 The semantics of pack() and unpack() regarding UTF-8-encoded data has been
23 changed. Processing is now by default character per character instead of
24 byte per byte on the underlying encoding. Notably, code that used things
25 like C<pack("a*", $string)> to see through the encoding of string will now
26 simply get back the original $string. Packed strings can also get upgraded
27 during processing when you store upgraded characters. You can get the old
28 behaviour by using C<use bytes>.
29
30 To be consistent with pack(), the C<C0> in unpack() templates indicates
31 that the data is to be processed in character mode, i.e. character by
32 character; on the contrary, C<U0> in unpack() indicates UTF-8 mode, where
33 the packed string is processed in its UTF-8-encoded Unicode form on a byte
34 by byte basis. This is reversed with regard to perl 5.8.X.
35
36 Moreover, C<C0> and C<U0> can also be used in pack() templates to specify
37 respectively character and byte modes.
38
39 C<C0> and C<U0> in the middle of a pack or unpack format now switch to the
40 specified encoding mode, honoring parens grouping. Previously, parens were
41 ignored.
42
43 Also, there is a new pack() character format, C<W>, which is intended to
44 replace the old C<C>. C<C> is kept for unsigned chars coded as bytes in
45 the strings internal representation. C<W> represents unsigned (logical)
46 character values, which can be greater than 255. It is therefore more
47 robust when dealing with potentially UTF-8-encoded data (as C<C> will wrap
48 values outside the range 0..255, and not respect the string encoding).
49
50 In practice, that means that pack formats are now encoding-neutral, except
51 C<C>.
52
53 For consistency, C<A> in unpack() format now trims all Unicode whitespace
54 from the end of the string. Before perl 5.9.2, it used to strip only the
55 classical ASCII space characters.
56
57 =head2 Byte/character count feature in unpack()
58
59 A new unpack() template character, C<".">, returns the number of bytes or
60 characters (depending on the selected encoding mode, see above) read so far.
61
62 =head2 The C<$*> and C<$#> variables have been removed
63
64 C<$*>, which was deprecated in favor of the C</s> and C</m> regexp
65 modifiers, has been removed.
66
67 The deprecated C<$#> variable (output format for numbers) has been
68 removed.
69
70 Two new warnings, C<$#/$* is no longer supported>, have been added.
71
72 =head2 substr() lvalues are no longer fixed-length
73
74 The lvalues returned by the three argument form of substr() used to be a
75 "fixed length window" on the original string. In some cases this could
76 cause surprising action at distance or other undefined behaviour. Now the
77 length of the window adjusts itself to the length of the string assigned to
78 it.
79
80 =head2 Parsing of C<-f _>
81
82 The identifier C<_> is now forced to be a bareword after a filetest
83 operator. This solves a number of misparsing issues when a global C<_>
84 subroutine is defined.
85
86 =head2 C<:unique>
87
88 The C<:unique> attribute has been made a no-op, since its current
89 implementation was fundamentally flawed and not threadsafe.
90
91 =head2 Scoping of the C<sort> pragma
92
93 The C<sort> pragma is now lexically scoped. Its effect used to be global.
94
95 =head2 Scoping of C<bignum>, C<bigint>, C<bigrat>
96
97 The three numeric pragmas C<bignum>, C<bigint> and C<bigrat> are now
98 lexically scoped. (Tels)
99
100 =head2 Effect of pragmas in eval
101
102 The compile-time value of the C<%^H> hint variable can now propagate into
103 eval("")uated code. This makes it more useful to implement lexical
104 pragmas.
105
106 As a side-effect of this, the overloaded-ness of constants now propagates
107 into eval("").
108
109 =head2 chdir FOO
110
111 A bareword argument to chdir() is now recognized as a file handle.
112 Earlier releases interpreted the bareword as a directory name.
113 (Gisle Aas)
114
115 =head2 Handling of .pmc files
116
117 An old feature of perl was that before C<require> or C<use> look for a
118 file with a F<.pm> extension, they will first look for a similar filename
119 with a F<.pmc> extension. If this file is found, it will be loaded in
120 place of any potentially existing file ending in a F<.pm> extension.
121
122 Previously, F<.pmc> files were loaded only if more recent than the
123 matching F<.pm> file. Starting with 5.9.4, they'll be always loaded if
124 they exist.
125
126 =head2 @- and @+ in patterns
127
128 The special arrays C<@-> and C<@+> are no longer interpolated in regular
129 expressions. (Sadahiro Tomoyuki)
130
131 =head2 $AUTOLOAD can now be tainted
132
133 If you call a subroutine by a tainted name, and if it defers to an
134 AUTOLOAD function, then $AUTOLOAD will be (correctly) tainted.
135 (Rick Delaney)
136
137 =head2 Tainting and printf
138
139 When perl is run under taint mode, C<printf()> and C<sprintf()> will now
140 reject any tainted format argument. (Rafael Garcia-Suarez)
141
142 =head2 undef and signal handlers
143
144 Undefining or deleting a signal handler via C<undef $SIG{FOO}> is now
145 equivalent to setting it to C<'DEFAULT'>. (Rafael Garcia-Suarez)
146
147 =head2 strictures and array/hash dereferencing in defined()
148
149 C<defined @$foo> and C<defined %$bar> are now subject to C<strict 'refs'>
150 (that is, C<$foo> and C<$bar> shall be proper references there.)
151 (Nicholas Clark)
152
153 (However, C<defined(@foo)> and C<defined(%bar)> are discouraged constructs
154 anyway.)
155
156 =head2 C<(?p{})> has been removed
157
158 The regular expression construct C<(?p{})>, which was deprecated in perl
159 5.8, has been removed. Use C<(??{})> instead. (Rafael Garcia-Suarez)
160
161 =head2 Pseudo-hashes have been removed
162
163 Support for pseudo-hashes has been removed from Perl 5.9. (The C<fields>
164 pragma remains here, but uses an alternate implementation.)
165
166 =head2 Removal of the bytecode compiler and of perlcc
167
168 C<perlcc>, the byteloader and the supporting modules (B::C, B::CC,
169 B::Bytecode, etc.) are no longer distributed with the perl sources. Those
170 experimental tools have never worked reliably, and, due to the lack of
171 volunteers to keep them in line with the perl interpreter developments, it
172 was decided to remove them instead of shipping a broken version of those.
173 The last version of those modules can be found with perl 5.9.4.
174
175 However the B compiler framework stays supported in the perl core, as with
176 the more useful modules it has permitted (among others, B::Deparse and
177 B::Concise).
178
179 =head2 Removal of the JPL
180
181 The JPL (Java-Perl Linguo) has been removed from the perl sources tarball.
182
183 =head2 Recursive inheritance detected earlier
184
185 Perl will now immediately throw an exception if you modify any package's
186 C<@ISA> in such a way that it would cause recursive inheritance.
187
188 Previously, the exception would not occur until Perl attempted to make
189 use of the recursive inheritance while resolving a method or doing a
190 C<$foo-E<gt>isa($bar)> lookup.
191
192 =head1 Core Enhancements
193
194 =head2 The C<feature> pragma
195
196 The C<feature> pragma is used to enable new syntax that would break Perl's
197 backwards-compatibility with older releases of the language. It's a lexical
198 pragma, like C<strict> or C<warnings>.
199
200 Currently the following new features are available: C<switch> (adds a
201 switch statement), C<say> (adds a C<say> built-in function), and C<state>
202 (adds an C<state> keyword for declaring "static" variables). Those
203 features are described in their own sections of this document.
204
205 The C<feature> pragma is also implicitly loaded when you require a minimal
206 perl version (with the C<use VERSION> construct) greater than, or equal
207 to, 5.9.5. See L<feature> for details.
208
209 =head2 New B<-E> command-line switch
210
211 B<-E> is equivalent to B<-e>, but it implicitly enables all
212 optional features (like C<use feature ":5.10">).
213
214 =head2 Defined-or operator
215
216 A new operator C<//> (defined-or) has been implemented.
217 The following statement:
218
219     $a // $b
220
221 is merely equivalent to
222
223    defined $a ? $a : $b
224
225 and
226
227    $c //= $d;
228
229 can now be used instead of
230
231    $c = $d unless defined $c;
232
233 The C<//> operator has the same precedence and associativity as C<||>.
234 Special care has been taken to ensure that this operator Do What You Mean
235 while not breaking old code, but some edge cases involving the empty
236 regular expression may now parse differently.  See L<perlop> for
237 details.
238
239 =head2 Switch and Smart Match operator
240
241 Perl 5 now has a switch statement. It's available when C<use feature
242 'switch'> is in effect. This feature introduces three new keywords,
243 C<given>, C<when>, and C<default>:
244
245     given ($foo) {
246         when (/^abc/) { $abc = 1; }
247         when (/^def/) { $def = 1; }
248         when (/^xyz/) { $xyz = 1; }
249         default { $nothing = 1; }
250     }
251
252 A more complete description of how Perl matches the switch variable
253 against the C<when> conditions is given in L<perlsyn/"Switch statements">.
254
255 This kind of match is called I<smart match>, and it's also possible to use
256 it outside of switch statements, via the new C<~~> operator. See
257 L<perlsyn/"Smart matching in detail">.
258
259 This feature was contributed by Robin Houston.
260
261 =head2 Regular expressions
262
263 =over 4
264
265 =item Recursive Patterns
266
267 It is now possible to write recursive patterns without using the C<(??{})>
268 construct. This new way is more efficient, and in many cases easier to
269 read.
270
271 Each capturing parenthesis can now be treated as an independent pattern
272 that can be entered by using the C<(?PARNO)> syntax (C<PARNO> standing for
273 "parenthesis number"). For example, the following pattern will match
274 nested balanced angle brackets:
275
276     /
277      ^                      # start of line
278      (                      # start capture buffer 1
279         <                   #   match an opening angle bracket
280         (?:                 #   match one of:
281             (?>             #     don't backtrack over the inside of this group
282                 [^<>]+      #       one or more non angle brackets
283             )               #     end non backtracking group
284         |                   #     ... or ...
285             (?1)            #     recurse to bracket 1 and try it again
286         )*                  #   0 or more times.
287         >                   #   match a closing angle bracket
288      )                      # end capture buffer one
289      $                      # end of line
290     /x
291
292 Note, users experienced with PCRE will find that the Perl implementation
293 of this feature differs from the PCRE one in that it is possible to
294 backtrack into a recursed pattern, whereas in PCRE the recursion is
295 atomic or "possessive" in nature. (Yves Orton)
296
297 =item Named Capture Buffers
298
299 It is now possible to name capturing parenthesis in a pattern and refer to
300 the captured contents by name. The naming syntax is C<< (?<NAME>....) >>.
301 It's possible to backreference to a named buffer with the C<< \k<NAME> >>
302 syntax. In code, the new magical hashes C<%+> and C<%-> can be used to
303 access the contents of the capture buffers.
304
305 Thus, to replace all doubled chars, one could write
306
307     s/(?<letter>.)\k<letter>/$+{letter}/g
308
309 Only buffers with defined contents will be "visible" in the C<%+> hash, so
310 it's possible to do something like
311
312     foreach my $name (keys %+) {
313         print "content of buffer '$name' is $+{$name}\n";
314     }
315
316 The C<%-> hash is a bit more complete, since it will contain array refs
317 holding values from all capture buffers similarly named, if there should
318 be many of them.
319
320 C<%+> and C<%-> are implemented as tied hashes through the new module
321 C<Tie::Hash::NamedCapture>.
322
323 Users exposed to the .NET regex engine will find that the perl
324 implementation differs in that the numerical ordering of the buffers
325 is sequential, and not "unnamed first, then named". Thus in the pattern
326
327    /(A)(?<B>B)(C)(?<D>D)/
328
329 $1 will be 'A', $2 will be 'B', $3 will be 'C' and $4 will be 'D' and not
330 $1 is 'A', $2 is 'C' and $3 is 'B' and $4 is 'D' that a .NET programmer
331 would expect. This is considered a feature. :-) (Yves Orton)
332
333 =item Possessive Quantifiers
334
335 Perl now supports the "possessive quantifier" syntax of the "atomic match"
336 pattern. Basically a possessive quantifier matches as much as it can and never
337 gives any back. Thus it can be used to control backtracking. The syntax is
338 similar to non-greedy matching, except instead of using a '?' as the modifier
339 the '+' is used. Thus C<?+>, C<*+>, C<++>, C<{min,max}+> are now legal
340 quantifiers. (Yves Orton)
341
342 =item Backtracking control verbs
343
344 The regex engine now supports a number of special-purpose backtrack
345 control verbs: (*THEN), (*PRUNE), (*MARK), (*SKIP), (*COMMIT), (*FAIL)
346 and (*ACCEPT). See L<perlre> for their descriptions. (Yves Orton)
347
348 =item Relative backreferences
349
350 A new syntax C<\g{N}> or C<\gN> where "N" is a decimal integer allows a
351 safer form of back-reference notation as well as allowing relative
352 backreferences. This should make it easier to generate and embed patterns
353 that contain backreferences. See L<perlre/"Capture buffers">. (Yves Orton)
354
355 =item C<\K> escape
356
357 The functionality of Jeff Pinyan's module Regexp::Keep has been added to
358 the core. You can now use in regular expressions the special escape C<\K>
359 as a way to do something like floating length positive lookbehind. It is
360 also useful in substitutions like:
361
362   s/(foo)bar/$1/g
363
364 that can now be converted to
365
366   s/foo\Kbar//g
367
368 which is much more efficient. (Yves Orton)
369
370 =item Vertical and horizontal whitespace, and linebreak
371
372 Regular expressions now recognize the C<\v> and C<\h> escapes, that match
373 vertical and horizontal whitespace, respectively. C<\V> and C<\H>
374 logically match their complements.
375
376 C<\R> matches a generic linebreak, that is, vertical whitespace, plus
377 the multi-character sequence C<"\x0D\x0A">.
378
379 =item Unicode Character Classes
380
381 Perl's regular expression engine now contains support for matching on the
382 intersection of two Unicode character classes. You can also now refer to
383 user-defined character classes from within other user defined character
384 classes.
385
386 =back
387
388 =head2 C<say()>
389
390 say() is a new built-in, only available when C<use feature 'say'> is in
391 effect, that is similar to print(), but that implicitly appends a newline
392 to the printed string. See L<perlfunc/say>. (Robin Houston)
393
394 =head2 Lexical C<$_>
395
396 The default variable C<$_> can now be lexicalized, by declaring it like
397 any other lexical variable, with a simple
398
399     my $_;
400
401 The operations that default on C<$_> will use the lexically-scoped
402 version of C<$_> when it exists, instead of the global C<$_>.
403
404 In a C<map> or a C<grep> block, if C<$_> was previously my'ed, then the
405 C<$_> inside the block is lexical as well (and scoped to the block).
406
407 In a scope where C<$_> has been lexicalized, you can still have access to
408 the global version of C<$_> by using C<$::_>, or, more simply, by
409 overriding the lexical declaration with C<our $_>.
410
411 =head2 The C<_> prototype
412
413 A new prototype character has been added. C<_> is equivalent to C<$> (it
414 denotes a scalar), but defaults to C<$_> if the corresponding argument
415 isn't supplied. Due to the optional nature of the argument, you can only
416 use it at the end of a prototype, or before a semicolon.
417
418 This has a small incompatible consequence: the prototype() function has
419 been adjusted to return C<_> for some built-ins in appropriate cases (for
420 example, C<prototype('CORE::rmdir')>). (Rafael Garcia-Suarez)
421
422 =head2 UNITCHECK blocks
423
424 C<UNITCHECK>, a new special code block has been introduced, in addition to
425 C<BEGIN>, C<CHECK>, C<INIT> and C<END>.
426
427 C<CHECK> and C<INIT> blocks, while useful for some specialized purposes,
428 are always executed at the transition between the compilation and the
429 execution of the main program, and thus are useless whenever code is
430 loaded at runtime. On the other hand, C<UNITCHECK> blocks are executed
431 just after the unit which defined them has been compiled. See L<perlmod>
432 for more information. (Alex Gough)
433
434 =head2 New Pragma, C<mro>
435
436 A new pragma, C<mro> (for Method Resolution Order) has been added. It
437 permits to switch, on a per-class basis, the algorithm that perl uses to
438 find inherited methods in case of a mutiple inheritance hierachy. The
439 default MRO hasn't changed (DFS, for Depth First Search). Another MRO is
440 available: the C3 algorithm. See L<mro> for more information.
441 (Brandon Black)
442
443 Note that, due to changes in the implentation of class hierarchy search,
444 code that used to undef the C<*ISA> glob will most probably break. Anyway,
445 undef'ing C<*ISA> had the side-effect of removing the magic on the @ISA
446 array and should not have been done in the first place.
447
448 =head2 readpipe() is now overridable
449
450 The built-in function readpipe() is now overridable. Overriding it permits
451 also to override its operator counterpart, C<qx//> (a.k.a. C<``>).
452 Moreover, it now defaults to C<$_> if no argument is provided. (Rafael
453 Garcia-Suarez)
454
455 =head2 default argument for readline()
456
457 readline() now defaults to C<*ARGV> if no argument is provided. (Rafael
458 Garcia-Suarez)
459
460 =head2 state() variables
461
462 A new class of variables has been introduced. State variables are similar
463 to C<my> variables, but are declared with the C<state> keyword in place of
464 C<my>. They're visible only in their lexical scope, but their value is
465 persistent: unlike C<my> variables, they're not undefined at scope entry,
466 but retain their previous value. (Rafael Garcia-Suarez, Nicholas Clark)
467
468 To use state variables, one needs to enable them by using
469
470     use feature "state";
471
472 or by using the C<-E> command-line switch in one-liners.
473 See L<perlsub/"Persistent variables via state()">.
474
475 =head2 Stacked filetest operators
476
477 As a new form of syntactic sugar, it's now possible to stack up filetest
478 operators. You can now write C<-f -w -x $file> in a row to mean
479 C<-x $file && -w _ && -f _>. See L<perlfunc/-X>.
480
481 =head2 UNIVERSAL::DOES()
482
483 The C<UNIVERSAL> class has a new method, C<DOES()>. It has been added to
484 solve semantic problems with the C<isa()> method. C<isa()> checks for
485 inheritance, while C<DOES()> has been designed to be overridden when
486 module authors use other types of relations between classes (in addition
487 to inheritance). (chromatic)
488
489 See L<< UNIVERSAL/"$obj->DOES( ROLE )" >>.
490
491 =head2 C<CLONE_SKIP()>
492
493 Perl has now support for the C<CLONE_SKIP> special subroutine. Like
494 C<CLONE>, C<CLONE_SKIP> is called once per package; however, it is called
495 just before cloning starts, and in the context of the parent thread. If it
496 returns a true value, then no objects of that class will be cloned. See
497 L<perlmod> for details. (Contributed by Dave Mitchell.)
498
499 =head2 Formats
500
501 Formats were improved in several ways. A new field, C<^*>, can be used for
502 variable-width, one-line-at-a-time text. Null characters are now handled
503 correctly in picture lines. Using C<@#> and C<~~> together will now
504 produce a compile-time error, as those format fields are incompatible.
505 L<perlform> has been improved, and miscellaneous bugs fixed.
506
507 =head2 Byte-order modifiers for pack() and unpack()
508
509 There are two new byte-order modifiers, C<E<gt>> (big-endian) and C<E<lt>>
510 (little-endian), that can be appended to most pack() and unpack() template
511 characters and groups to force a certain byte-order for that type or group.
512 See L<perlfunc/pack> and L<perlpacktut> for details.
513
514 =head2 C<no VERSION>
515
516 You can now use C<no> followed by a version number to specify that you
517 want to use a version of perl older than the specified one.
518
519 =head2 C<chdir>, C<chmod> and C<chown> on filehandles
520
521 C<chdir>, C<chmod> and C<chown> can now work on filehandles as well as
522 filenames, if the system supports respectively C<fchdir>, C<fchmod> and
523 C<fchown>, thanks to a patch provided by Gisle Aas.
524
525 =head2 OS groups
526
527 C<$(> and C<$)> now return groups in the order where the OS returns them,
528 thanks to Gisle Aas. This wasn't previously the case.
529
530 =head2 Recursive sort subs
531
532 You can now use recursive subroutines with sort(), thanks to Robin Houston.
533
534 =head2 Exceptions in constant folding
535
536 The constant folding routine is now wrapped in an exception handler, and
537 if folding throws an exception (such as attempting to evaluate 0/0), perl
538 now retains the current optree, rather than aborting the whole program.
539 (Nicholas Clark, Dave Mitchell)
540
541 =head2 Source filters in @INC
542
543 It's possible to enhance the mechanism of subroutine hooks in @INC by
544 adding a source filter on top of the filehandle opened and returned by the
545 hook. This feature was planned a long time ago, but wasn't quite working
546 until now. See L<perlfunc/require> for details. (Nicholas Clark)
547
548 =head2 New internal variables
549
550 =over 4
551
552 =item C<${^RE_DEBUG_FLAGS}>
553
554 This variable controls what debug flags are in effect for the regular
555 expression engine when running under C<use re "debug">. See L<re> for
556 details.
557
558 =item C<${^CHILD_ERROR_NATIVE}>
559
560 This variable gives the native status returned by the last pipe close,
561 backtick command, successful call to wait() or waitpid(), or from the
562 system() operator. See L<perlrun> for details. (Contributed by Gisle Aas.)
563
564 =back
565
566 =head2 Miscellaneous
567
568 C<unpack()> now defaults to unpacking the C<$_> variable.
569
570 C<mkdir()> without arguments now defaults to C<$_>.
571
572 The internal dump output has been improved, so that non-printable characters
573 such as newline and backspace are output in C<\x> notation, rather than
574 octal.
575
576 The B<-C> option can no longer be used on the C<#!> line. It wasn't
577 working there anyway.
578
579 =head2 PERLIO_DEBUG
580
581 The C<PERLIO_DEBUG> environment variable has no longer any effect for
582 setuid scripts and for scripts run with B<-T>.
583
584 Moreover, with a thread-enabled perl, using C<PERLIO_DEBUG> could lead to
585 an internal buffer overflow. This has been fixed.
586
587 =head2 UCD 5.0.0
588
589 The copy of the Unicode Character Database included in Perl 5 has
590 been updated to version 5.0.0.
591
592 =head2 MAD
593
594 MAD, which stands for I<Misc Attribute Decoration>, is a
595 still-in-development work leading to a Perl 5 to Perl 6 converter. To
596 enable it, it's necessary to pass the argument C<-Dmad> to Configure. The
597 obtained perl isn't binary compatible with a regular perl 5.9.4, and has
598 space and speed penalties; moreover not all regression tests still pass
599 with it. (Larry Wall, Nicholas Clark)
600
601 =head1 Modules and Pragmata
602
603 =head2 New modules
604
605 =over 4
606
607 =item *
608
609 C<encoding::warnings>, by Audrey Tang, is a module to emit warnings
610 whenever an ASCII character string containing high-bit bytes is implicitly
611 converted into UTF-8.
612
613 =item *
614
615 C<Module::CoreList>, by Richard Clamp, is a small handy module that tells
616 you what versions of core modules ship with any versions of Perl 5. It
617 comes with a command-line frontend, C<corelist>.
618
619 =back
620
621 =head1 Utility Changes
622
623 =over 4
624
625 =item *
626
627 The Perl debugger can now save all debugger commands for sourcing later;
628 notably, it can now emulate stepping backwards, by restarting and
629 rerunning all bar the last command from a saved command history.
630
631 It can also display the parent inheritance tree of a given class, with the
632 C<i> command.
633
634 Perl has a new -dt command-line flag, which enables threads support in the
635 debugger.
636
637 =item *
638
639 The C<corelist> utility is now installed with perl (see L</"New modules">
640 above).
641
642 =item *
643
644 C<h2ph> and C<h2xs> have been made a bit more robust with regard to
645 "modern" C code.
646
647 =item *
648
649 C<find2perl> now assumes C<-print> as a default action. Previously, it
650 needed to be specified explicitly.
651
652 Several bugs have been fixed in C<find2perl>, regarding C<-exec> and
653 C<-eval>. Also the options C<-path>, C<-ipath> and C<-iname> have been
654 added.
655
656 =back
657
658 =head1 New Documentation
659
660 The long-existing feature of C</(?{...})/> regexps setting C<$_> and pos()
661 is now documented.
662
663 =head1 Performance Enhancements
664
665 =over 4
666
667 =item *
668
669 Sorting arrays in place (C<@a = sort @a>) is now optimized to avoid
670 making a temporary copy of the array.
671
672 Likewise, C<reverse sort ...> is now optimized to sort in reverse,
673 avoiding the generation of a temporary intermediate list.
674
675 =item *
676
677 Access to elements of lexical arrays via a numeric constant between 0 and
678 255 is now faster. (This used to be only the case for global arrays.)
679
680 =item *
681
682 The regexp engine now implements the trie optimization : it's able to
683 factorize common prefixes and suffixes in regular expressions. A new
684 special variable, ${^RE_TRIE_MAXBUF}, has been added to fine-tune this
685 optimization.
686
687 =back
688
689 =head1 Installation and Configuration Improvements
690
691 Run-time customization of @INC can be enabled by passing the
692 C<-Dusesitecustomize> flag to configure. When enabled, this will make perl
693 run F<$sitelibexp/sitecustomize.pl> before anything else.  This script can
694 then be set up to add additional entries to @INC.
695
696 There is alpha support for relocatable @INC entries.
697
698 =head1 Selected Bug Fixes
699
700 C<strict> wasn't in effect in regexp-eval blocks (C</(?{...})/>).
701
702 C<$Foo::_> was wrongly forced as C<$main::_>.
703
704 =head1 New or Changed Diagnostics
705
706 A new deprecation warning, I<Deprecated use of my() in false conditional>,
707 has been added, to warn against the use of the dubious and deprecated
708 construct
709
710     my $x if 0;
711
712 See L<perldiag>. Use C<state> variables instead.
713
714 A new warning, C<!=~ should be !~>, is emitted to prevent this misspelling
715 of the non-matching operator.
716
717 The warning I<Newline in left-justified string> has been removed.
718
719 The error I<Too late for "-T" option> has been reformulated to be more
720 descriptive.
721
722 C<perl -V> has several improvements, making it more useable from shell
723 scripts to get the value of configuration variables. See L<perlrun> for
724 details.
725
726 =head1 Changed Internals
727
728 =head2 Reordering of SVt_* constants
729
730 The relative ordering of constants that define the various types of C<SV>
731 have changed; in particular, C<SVt_PVGV> has been moved before C<SVt_PVLV>,
732 C<SVt_PVAV>, C<SVt_PVHV> and C<SVt_PVCV>.  This is unlikely to make any
733 difference unless you have code that explicitly makes assumptions about that
734 ordering. (The inheritance hierarchy of C<B::*> objects has been changed
735 to reflect this.)
736
737 =head2 Removal of CPP symbols
738
739 The C preprocessor symbols C<PERL_PM_APIVERSION> and
740 C<PERL_XS_APIVERSION>, which were supposed to give the version number of
741 the oldest perl binary-compatible (resp. source-compatible) with the
742 present one, were not used, and sometimes had misleading values. They have
743 been removed.
744
745 =head2 Less space is used by ops
746
747 The C<BASEOP> structure now uses less space. The C<op_seq> field has been
748 removed and replaced by the one-bit fields C<op_opt>. C<op_type> is now 9
749 bits long. (Consequently, the C<B::OP> class doesn't provide an C<seq>
750 method anymore.)
751
752 =head2 New parser
753
754 perl's parser is now generated by bison (it used to be generated by
755 byacc.) As a result, it seems to be a bit more robust.
756
757 =head1 New Tests
758
759 =head1 Known Problems
760
761 There's still a remaining problem in the implementation of the lexical
762 C<$_>: it doesn't work inside C</(?{...})/> blocks. (See the TODO test in
763 F<t/op/mydef.t>.)
764
765 =head1 Platform Specific Problems
766
767 =head1 Reporting Bugs
768
769 =head1 SEE ALSO
770
771 The F<Changes> file and the perl590delta to perl595delta man pages for
772 exhaustive details on what changed.
773
774 The F<INSTALL> file for how to build Perl.
775
776 The F<README> file for general stuff.
777
778 The F<Artistic> and F<Copying> files for copyright information.
779
780 =cut