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