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