3 perldelta - what is new for perl 5.10.0
7 This document describes the differences between the 5.8.8 release and
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.
14 =head1 Incompatible Changes
16 =head2 Packing and UTF-8 strings
20 The semantics of pack() and unpack() regarding UTF-8-encoded data has been
21 changed. Processing is now by default character per character instead of
22 byte per byte on the underlying encoding. Notably, code that used things
23 like C<pack("a*", $string)> to see through the encoding of string will now
24 simply get back the original $string. Packed strings can also get upgraded
25 during processing when you store upgraded characters. You can get the old
26 behaviour by using C<use bytes>.
28 To be consistent with pack(), the C<C0> in unpack() templates indicates
29 that the data is to be processed in character mode, i.e. character by
30 character; on the contrary, C<U0> in unpack() indicates UTF-8 mode, where
31 the packed string is processed in its UTF-8-encoded Unicode form on a byte
32 by byte basis. This is reversed with regard to perl 5.8.X.
34 Moreover, C<C0> and C<U0> can also be used in pack() templates to specify
35 respectively character and byte modes.
37 C<C0> and C<U0> in the middle of a pack or unpack format now switch to the
38 specified encoding mode, honoring parens grouping. Previously, parens were
41 Also, there is a new pack() character format, C<W>, which is intended to
42 replace the old C<C>. C<C> is kept for unsigned chars coded as bytes in
43 the strings internal representation. C<W> represents unsigned (logical)
44 character values, which can be greater than 255. It is therefore more
45 robust when dealing with potentially UTF-8-encoded data (as C<C> will wrap
46 values outside the range 0..255, and not respect the string encoding).
48 In practice, that means that pack formats are now encoding-neutral, except
51 For consistency, C<A> in unpack() format now trims all Unicode whitespace
52 from the end of the string. Before perl 5.9.2, it used to strip only the
53 classical ASCII space characters.
55 =head2 Byte/character count feature in unpack()
57 A new unpack() template character, C<".">, returns the number of bytes or
58 characters (depending on the selected encoding mode, see above) read so far.
60 =head2 The C<$*> and C<$#> variables have been removed
62 C<$*>, which was deprecated in favor of the C</s> and C</m> regexp
63 modifiers, has been removed.
65 The deprecated C<$#> variable (output format for numbers) has been
68 Two new warnings, C<$#/$* is no longer supported>, have been added.
70 =head2 substr() lvalues are no longer fixed-length
72 The lvalues returned by the three argument form of substr() used to be a
73 "fixed length window" on the original string. In some cases this could
74 cause surprising action at distance or other undefined behaviour. Now the
75 length of the window adjusts itself to the length of the string assigned to
78 =head2 Parsing of C<-f _>
80 The identifier C<_> is now forced to be a bareword after a filetest
81 operator. This solves a number of misparsing issues when a global C<_>
82 subroutine is defined.
86 The C<:unique> attribute has been made a no-op, since its current
87 implementation was fundamentally flawed and not threadsafe.
89 =head2 Scoping of the C<sort> pragma
91 The C<sort> pragma is now lexically scoped. Its effect used to be global.
93 =head2 Scoping of C<bignum>, C<bigint>, C<bigrat>
95 The three numeric pragmas C<bignum>, C<bigint> and C<bigrat> are now
96 lexically scoped. (Tels)
98 =head2 Effect of pragmas in eval
100 The compile-time value of the C<%^H> hint variable can now propagate into
101 eval("")uated code. This makes it more useful to implement lexical
104 As a side-effect of this, the overloaded-ness of constants now propagates
109 A bareword argument to chdir() is now recognized as a file handle.
110 Earlier releases interpreted the bareword as a directory name.
113 =head2 Handling of .pmc files
115 An old feature of perl was that before C<require> or C<use> look for a
116 file with a F<.pm> extension, they will first look for a similar filename
117 with a F<.pmc> extension. If this file is found, it will be loaded in
118 place of any potentially existing file ending in a F<.pm> extension.
120 Previously, F<.pmc> files were loaded only if more recent than the
121 matching F<.pm> file. Starting with 5.9.4, they'll be always loaded if
124 =head2 @- and @+ in patterns
126 The special arrays C<@-> and C<@+> are no longer interpolated in regular
127 expressions. (Sadahiro Tomoyuki)
129 =head2 $AUTOLOAD can now be tainted
131 If you call a subroutine by a tainted name, and if it defers to an
132 AUTOLOAD function, then $AUTOLOAD will be (correctly) tainted.
135 =head2 Tainting and printf
137 When perl is run under taint mode, C<printf()> and C<sprintf()> will now
138 reject any tainted format argument. (Rafael Garcia-Suarez)
140 =head2 undef and signal handlers
142 Undefining or deleting a signal handler via C<undef $SIG{FOO}> is now
143 equivalent to setting it to C<'DEFAULT'>. (Rafael Garcia-Suarez)
145 =head2 strictures and array/hash dereferencing in defined()
147 C<defined @$foo> and C<defined %$bar> are now subject to C<strict 'refs'>
148 (that is, C<$foo> and C<$bar> shall be proper references there.)
151 (However, C<defined(@foo)> and C<defined(%bar)> are discouraged constructs
154 =head2 C<(?p{})> has been removed
156 The regular expression construct C<(?p{})>, which was deprecated in perl
157 5.8, has been removed. Use C<(??{})> instead. (Rafael Garcia-Suarez)
159 =head2 Pseudo-hashes have been removed
161 Support for pseudo-hashes has been removed from Perl 5.9. (The C<fields>
162 pragma remains here, but uses an alternate implementation.)
164 =head2 Removal of the bytecode compiler and of perlcc
166 C<perlcc>, the byteloader and the supporting modules (B::C, B::CC,
167 B::Bytecode, etc.) are no longer distributed with the perl sources. Those
168 experimental tools have never worked reliably, and, due to the lack of
169 volunteers to keep them in line with the perl interpreter developments, it
170 was decided to remove them instead of shipping a broken version of those.
171 The last version of those modules can be found with perl 5.9.4.
173 However the B compiler framework stays supported in the perl core, as with
174 the more useful modules it has permitted (among others, B::Deparse and
177 =head2 Removal of the JPL
179 The JPL (Java-Perl Linguo) has been removed from the perl sources tarball.
181 =head2 Recursive inheritance detected earlier
183 Perl will now immediately throw an exception if you modify any package's
184 C<@ISA> in such a way that it would cause recursive inheritance.
186 Previously, the exception would not occur until Perl attempted to make
187 use of the recursive inheritance while resolving a method or doing a
188 C<$foo-E<gt>isa($bar)> lookup.
190 =head1 Core Enhancements
192 =head2 The C<feature> pragma
194 The C<feature> pragma is used to enable new syntax that would break Perl's
195 backwards-compatibility with older releases of the language. It's a lexical
196 pragma, like C<strict> or C<warnings>.
198 Currently the following new features are available: C<switch> (adds a
199 switch statement), C<say> (adds a C<say> built-in function), and C<state>
200 (adds an C<state> keyword for declaring "static" variables). Those
201 features are described in their own sections of this document.
203 The C<feature> pragma is also implicitly loaded when you require a minimal
204 perl version (with the C<use VERSION> construct) greater than, or equal
205 to, 5.9.5. See L<feature> for details.
207 =head2 New B<-E> command-line switch
209 B<-E> is equivalent to B<-e>, but it implicitly enables all
210 optional features (like C<use feature ":5.10">).
212 =head2 Defined-or operator
214 A new operator C<//> (defined-or) has been implemented.
215 The following statement:
219 is merely equivalent to
227 can now be used instead of
229 $c = $d unless defined $c;
231 The C<//> operator has the same precedence and associativity as C<||>.
232 Special care has been taken to ensure that this operator Do What You Mean
233 while not breaking old code, but some edge cases involving the empty
234 regular expression may now parse differently. See L<perlop> for
237 =head2 Switch and Smart Match operator
239 Perl 5 now has a switch statement. It's available when C<use feature
240 'switch'> is in effect. This feature introduces three new keywords,
241 C<given>, C<when>, and C<default>:
244 when (/^abc/) { $abc = 1; }
245 when (/^def/) { $def = 1; }
246 when (/^xyz/) { $xyz = 1; }
247 default { $nothing = 1; }
250 A more complete description of how Perl matches the switch variable
251 against the C<when> conditions is given in L<perlsyn/"Switch statements">.
253 This kind of match is called I<smart match>, and it's also possible to use
254 it outside of switch statements, via the new C<~~> operator. See
255 L<perlsyn/"Smart matching in detail">.
257 This feature was contributed by Robin Houston.
259 =head2 Regular expressions
263 =item Recursive Patterns
265 It is now possible to write recursive patterns without using the C<(??{})>
266 construct. This new way is more efficient, and in many cases easier to
269 Each capturing parenthesis can now be treated as an independent pattern
270 that can be entered by using the C<(?PARNO)> syntax (C<PARNO> standing for
271 "parenthesis number"). For example, the following pattern will match
272 nested balanced angle brackets:
276 ( # start capture buffer 1
277 < # match an opening angle bracket
279 (?> # don't backtrack over the inside of this group
280 [^<>]+ # one or more non angle brackets
281 ) # end non backtracking group
283 (?1) # recurse to bracket 1 and try it again
284 )* # 0 or more times.
285 > # match a closing angle bracket
286 ) # end capture buffer one
290 Note, users experienced with PCRE will find that the Perl implementation
291 of this feature differs from the PCRE one in that it is possible to
292 backtrack into a recursed pattern, whereas in PCRE the recursion is
293 atomic or "possessive" in nature. (Yves Orton)
295 =item Named Capture Buffers
297 It is now possible to name capturing parenthesis in a pattern and refer to
298 the captured contents by name. The naming syntax is C<< (?<NAME>....) >>.
299 It's possible to backreference to a named buffer with the C<< \k<NAME> >>
300 syntax. In code, the new magical hashes C<%+> and C<%-> can be used to
301 access the contents of the capture buffers.
303 Thus, to replace all doubled chars, one could write
305 s/(?<letter>.)\k<letter>/$+{letter}/g
307 Only buffers with defined contents will be "visible" in the C<%+> hash, so
308 it's possible to do something like
310 foreach my $name (keys %+) {
311 print "content of buffer '$name' is $+{$name}\n";
314 The C<%-> hash is a bit more complete, since it will contain array refs
315 holding values from all capture buffers similarly named, if there should
318 C<%+> and C<%-> are implemented as tied hashes through the new module
319 C<Tie::Hash::NamedCapture>.
321 Users exposed to the .NET regex engine will find that the perl
322 implementation differs in that the numerical ordering of the buffers
323 is sequential, and not "unnamed first, then named". Thus in the pattern
325 /(A)(?<B>B)(C)(?<D>D)/
327 $1 will be 'A', $2 will be 'B', $3 will be 'C' and $4 will be 'D' and not
328 $1 is 'A', $2 is 'C' and $3 is 'B' and $4 is 'D' that a .NET programmer
329 would expect. This is considered a feature. :-) (Yves Orton)
331 =item Possessive Quantifiers
333 Perl now supports the "possessive quantifier" syntax of the "atomic match"
334 pattern. Basically a possessive quantifier matches as much as it can and never
335 gives any back. Thus it can be used to control backtracking. The syntax is
336 similar to non-greedy matching, except instead of using a '?' as the modifier
337 the '+' is used. Thus C<?+>, C<*+>, C<++>, C<{min,max}+> are now legal
338 quantifiers. (Yves Orton)
340 =item Backtracking control verbs
342 The regex engine now supports a number of special-purpose backtrack
343 control verbs: (*THEN), (*PRUNE), (*MARK), (*SKIP), (*COMMIT), (*FAIL)
344 and (*ACCEPT). See L<perlre> for their descriptions. (Yves Orton)
346 =item Relative backreferences
348 A new syntax C<\g{N}> or C<\gN> where "N" is a decimal integer allows a
349 safer form of back-reference notation as well as allowing relative
350 backreferences. This should make it easier to generate and embed patterns
351 that contain backreferences. See L<perlre/"Capture buffers">. (Yves Orton)
355 The functionality of Jeff Pinyan's module Regexp::Keep has been added to
356 the core. You can now use in regular expressions the special escape C<\K>
357 as a way to do something like floating length positive lookbehind. It is
358 also useful in substitutions like:
362 that can now be converted to
366 which is much more efficient. (Yves Orton)
368 =item Vertical and horizontal whitespace, and linebreak
370 Regular expressions now recognize the C<\v> and C<\h> escapes, that match
371 vertical and horizontal whitespace, respectively. C<\V> and C<\H>
372 logically match their complements.
374 C<\R> matches a generic linebreak, that is, vertical whitespace, plus
375 the multi-character sequence C<"\x0D\x0A">.
377 =item Unicode Character Classes
379 Perl's regular expression engine now contains support for matching on the
380 intersection of two Unicode character classes. You can also now refer to
381 user-defined character classes from within other user defined character
388 say() is a new built-in, only available when C<use feature 'say'> is in
389 effect, that is similar to print(), but that implicitly appends a newline
390 to the printed string. See L<perlfunc/say>. (Robin Houston)
394 The default variable C<$_> can now be lexicalized, by declaring it like
395 any other lexical variable, with a simple
399 The operations that default on C<$_> will use the lexically-scoped
400 version of C<$_> when it exists, instead of the global C<$_>.
402 In a C<map> or a C<grep> block, if C<$_> was previously my'ed, then the
403 C<$_> inside the block is lexical as well (and scoped to the block).
405 In a scope where C<$_> has been lexicalized, you can still have access to
406 the global version of C<$_> by using C<$::_>, or, more simply, by
407 overriding the lexical declaration with C<our $_>.
409 =head2 The C<_> prototype
411 A new prototype character has been added. C<_> is equivalent to C<$> (it
412 denotes a scalar), but defaults to C<$_> if the corresponding argument
413 isn't supplied. Due to the optional nature of the argument, you can only
414 use it at the end of a prototype, or before a semicolon.
416 This has a small incompatible consequence: the prototype() function has
417 been adjusted to return C<_> for some built-ins in appropriate cases (for
418 example, C<prototype('CORE::rmdir')>). (Rafael Garcia-Suarez)
420 =head2 UNITCHECK blocks
422 C<UNITCHECK>, a new special code block has been introduced, in addition to
423 C<BEGIN>, C<CHECK>, C<INIT> and C<END>.
425 C<CHECK> and C<INIT> blocks, while useful for some specialized purposes,
426 are always executed at the transition between the compilation and the
427 execution of the main program, and thus are useless whenever code is
428 loaded at runtime. On the other hand, C<UNITCHECK> blocks are executed
429 just after the unit which defined them has been compiled. See L<perlmod>
430 for more information. (Alex Gough)
432 =head2 New Pragma, C<mro>
434 A new pragma, C<mro> (for Method Resolution Order) has been added. It
435 permits to switch, on a per-class basis, the algorithm that perl uses to
436 find inherited methods in case of a mutiple inheritance hierachy. The
437 default MRO hasn't changed (DFS, for Depth First Search). Another MRO is
438 available: the C3 algorithm. See L<mro> for more information.
441 Note that, due to changes in the implentation of class hierarchy search,
442 code that used to undef the C<*ISA> glob will most probably break. Anyway,
443 undef'ing C<*ISA> had the side-effect of removing the magic on the @ISA
444 array and should not have been done in the first place.
446 =head2 readpipe() is now overridable
448 The built-in function readpipe() is now overridable. Overriding it permits
449 also to override its operator counterpart, C<qx//> (a.k.a. C<``>).
450 Moreover, it now defaults to C<$_> if no argument is provided. (Rafael
453 =head2 default argument for readline()
455 readline() now defaults to C<*ARGV> if no argument is provided. (Rafael
458 =head2 state() variables
460 A new class of variables has been introduced. State variables are similar
461 to C<my> variables, but are declared with the C<state> keyword in place of
462 C<my>. They're visible only in their lexical scope, but their value is
463 persistent: unlike C<my> variables, they're not undefined at scope entry,
464 but retain their previous value. (Rafael Garcia-Suarez, Nicholas Clark)
466 To use state variables, one needs to enable them by using
470 or by using the C<-E> command-line switch in one-liners.
471 See L<perlsub/"Persistent variables via state()">.
473 =head2 Stacked filetest operators
475 As a new form of syntactic sugar, it's now possible to stack up filetest
476 operators. You can now write C<-f -w -x $file> in a row to mean
477 C<-x $file && -w _ && -f _>. See L<perlfunc/-X>.
479 =head2 UNIVERSAL::DOES()
481 The C<UNIVERSAL> class has a new method, C<DOES()>. It has been added to
482 solve semantic problems with the C<isa()> method. C<isa()> checks for
483 inheritance, while C<DOES()> has been designed to be overridden when
484 module authors use other types of relations between classes (in addition
485 to inheritance). (chromatic)
487 See L<< UNIVERSAL/"$obj->DOES( ROLE )" >>.
489 =head2 C<CLONE_SKIP()>
491 Perl has now support for the C<CLONE_SKIP> special subroutine. Like
492 C<CLONE>, C<CLONE_SKIP> is called once per package; however, it is called
493 just before cloning starts, and in the context of the parent thread. If it
494 returns a true value, then no objects of that class will be cloned. See
495 L<perlmod> for details. (Contributed by Dave Mitchell.)
499 Formats were improved in several ways. A new field, C<^*>, can be used for
500 variable-width, one-line-at-a-time text. Null characters are now handled
501 correctly in picture lines. Using C<@#> and C<~~> together will now
502 produce a compile-time error, as those format fields are incompatible.
503 L<perlform> has been improved, and miscellaneous bugs fixed.
505 =head2 Byte-order modifiers for pack() and unpack()
507 There are two new byte-order modifiers, C<E<gt>> (big-endian) and C<E<lt>>
508 (little-endian), that can be appended to most pack() and unpack() template
509 characters and groups to force a certain byte-order for that type or group.
510 See L<perlfunc/pack> and L<perlpacktut> for details.
514 You can now use C<no> followed by a version number to specify that you
515 want to use a version of perl older than the specified one.
517 =head2 C<chdir>, C<chmod> and C<chown> on filehandles
519 C<chdir>, C<chmod> and C<chown> can now work on filehandles as well as
520 filenames, if the system supports respectively C<fchdir>, C<fchmod> and
521 C<fchown>, thanks to a patch provided by Gisle Aas.
525 C<$(> and C<$)> now return groups in the order where the OS returns them,
526 thanks to Gisle Aas. This wasn't previously the case.
528 =head2 Recursive sort subs
530 You can now use recursive subroutines with sort(), thanks to Robin Houston.
532 =head2 Exceptions in constant folding
534 The constant folding routine is now wrapped in an exception handler, and
535 if folding throws an exception (such as attempting to evaluate 0/0), perl
536 now retains the current optree, rather than aborting the whole program.
537 (Nicholas Clark, Dave Mitchell)
539 =head2 Source filters in @INC
541 It's possible to enhance the mechanism of subroutine hooks in @INC by
542 adding a source filter on top of the filehandle opened and returned by the
543 hook. This feature was planned a long time ago, but wasn't quite working
544 until now. See L<perlfunc/require> for details. (Nicholas Clark)
546 =head2 New internal variables
550 =item C<${^RE_DEBUG_FLAGS}>
552 This variable controls what debug flags are in effect for the regular
553 expression engine when running under C<use re "debug">. See L<re> for
556 =item C<${^CHILD_ERROR_NATIVE}>
558 This variable gives the native status returned by the last pipe close,
559 backtick command, successful call to wait() or waitpid(), or from the
560 system() operator. See L<perlrun> for details. (Contributed by Gisle Aas.)
566 C<unpack()> now defaults to unpacking the C<$_> variable.
568 C<mkdir()> without arguments now defaults to C<$_>.
570 The internal dump output has been improved, so that non-printable characters
571 such as newline and backspace are output in C<\x> notation, rather than
574 The B<-C> option can no longer be used on the C<#!> line. It wasn't
575 working there anyway.
579 The C<PERLIO_DEBUG> environment variable has no longer any effect for
580 setuid scripts and for scripts run with B<-T>.
582 Moreover, with a thread-enabled perl, using C<PERLIO_DEBUG> could lead to
583 an internal buffer overflow. This has been fixed.
587 The copy of the Unicode Character Database included in Perl 5 has
588 been updated to version 5.0.0.
592 MAD, which stands for I<Misc Attribute Decoration>, is a
593 still-in-development work leading to a Perl 5 to Perl 6 converter. To
594 enable it, it's necessary to pass the argument C<-Dmad> to Configure. The
595 obtained perl isn't binary compatible with a regular perl 5.9.4, and has
596 space and speed penalties; moreover not all regression tests still pass
597 with it. (Larry Wall, Nicholas Clark)
599 =head1 Modules and Pragmata
607 C<encoding::warnings>, by Audrey Tang, is a module to emit warnings
608 whenever an ASCII character string containing high-bit bytes is implicitly
609 converted into UTF-8.
613 C<Module::CoreList>, by Richard Clamp, is a small handy module that tells
614 you what versions of core modules ship with any versions of Perl 5. It
615 comes with a command-line frontend, C<corelist>.
619 C<Math::BigInt::FastCalc> is an XS-enabled, and thus faster, version of
620 C<Math::BigInt::Calc>.
624 C<Compress::Zlib> is an interface to the zlib compression library. It
625 comes with a bundled version of zlib, so having a working zlib is not a
626 prerequisite to install it. It's used by C<Archive::Tar> (see below).
630 C<IO::Zlib> is an C<IO::>-style interface to C<Compress::Zlib>.
634 C<Archive::Tar> is a module to manipulate C<tar> archives.
638 C<Digest::SHA> is a module used to calculate many types of SHA digests,
639 has been included for SHA support in the CPAN module.
643 C<ExtUtils::CBuilder> and C<ExtUtils::ParseXS> have been added.
647 =head1 Utility Changes
653 The Perl debugger can now save all debugger commands for sourcing later;
654 notably, it can now emulate stepping backwards, by restarting and
655 rerunning all bar the last command from a saved command history.
657 It can also display the parent inheritance tree of a given class, with the
660 Perl has a new -dt command-line flag, which enables threads support in the
665 C<ptar> is a pure perl implementation of C<tar>, that comes with
670 C<ptardiff> is a small script used to generate a diff between the contents
671 of a tar archive and a directory tree. Like C<ptar>, it comes with
676 C<shasum> is a command-line utility, used to print or to check SHA
677 digests. It comes with the new C<Digest::SHA> module.
681 The C<corelist> utility is now installed with perl (see L</"New modules">
686 C<h2ph> and C<h2xs> have been made a bit more robust with regard to
689 C<h2xs> implements a new option C<--use-xsloader> to force use of
690 C<XSLoader> even in backwards compatible modules.
692 The handling of authors' names that had apostrophes has been fixed.
694 Any enums with negative values are now skipped.
698 C<perlivp> no longer checks for F<*.ph> files by default. Use the new C<-a>
699 option to run I<all> tests.
703 C<find2perl> now assumes C<-print> as a default action. Previously, it
704 needed to be specified explicitly.
706 Several bugs have been fixed in C<find2perl>, regarding C<-exec> and
707 C<-eval>. Also the options C<-path>, C<-ipath> and C<-iname> have been
712 =head1 New Documentation
714 The new L<perlglossary> manpage is a glossary of terms used in the Perl
715 documentation, technical and otherwise, kindly provided by O'Reilly Media,
718 The long-existing feature of C</(?{...})/> regexps setting C<$_> and pos()
721 =head1 Performance Enhancements
725 =item In-place sorting
727 Sorting arrays in place (C<@a = sort @a>) is now optimized to avoid
728 making a temporary copy of the array.
730 Likewise, C<reverse sort ...> is now optimized to sort in reverse,
731 avoiding the generation of a temporary intermediate list.
733 =item Lexical array access
735 Access to elements of lexical arrays via a numeric constant between 0 and
736 255 is now faster. (This used to be only the case for global arrays.)
738 =item Trie optimization
740 The regexp engine now implements the trie optimization : it's able to
741 factorize common prefixes and suffixes in regular expressions. A new
742 special variable, ${^RE_TRIE_MAXBUF}, has been added to fine-tune this
745 =item XS-assisted SWASHGET
747 Some pure-perl code that perl was using to retrieve Unicode properties and
748 transliteration mappings has been reimplemented in XS.
750 =item Constant subroutines
752 The interpreter internals now support a far more memory efficient form of
753 inlineable constants. Storing a reference to a constant value in a symbol
754 table is equivalent to a full typeglob referencing a constant subroutine,
755 but using about 400 bytes less memory. This proxy constant subroutine is
756 automatically upgraded to a real typeglob with subroutine if necessary.
757 The approach taken is analogous to the existing space optimisation for
758 subroutine stub declarations, which are stored as plain scalars in place
759 of the full typeglob.
761 Several of the core modules have been converted to use this feature for
762 their system dependent constants - as a result C<use POSIX;> now takes about
765 =item C<PERL_DONT_CREATE_GVSV>
767 The new compilation flag C<PERL_DONT_CREATE_GVSV>, introduced as an option
768 in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl
769 from creating an empty scalar with every new typeglob. See L<perl588delta>
772 =item Weak references are cheaper
774 Weak reference creation is now I<O(1)> rather than I<O(n)>, courtesy of
775 Nicholas Clark. Weak reference deletion remains I<O(n)>, but if deletion only
776 happens at program exit, it may be skipped completely.
778 =item sort() enhancements
780 Salvador FandiƱo provided improvements to reduce the memory usage of C<sort>
781 and to speed up some cases.
785 =head1 Installation and Configuration Improvements
787 =head2 Compilation improvements
789 Run-time customization of @INC can be enabled by passing the
790 C<-Dusesitecustomize> flag to configure. When enabled, this will make perl
791 run F<$sitelibexp/sitecustomize.pl> before anything else. This script can
792 then be set up to add additional entries to @INC.
794 There is alpha support for relocatable @INC entries.
796 Parallel makes should work properly now, although there may still be problems
797 if C<make test> is instructed to run in parallel.
799 Building with Borland's compilers on Win32 should work more smoothly. In
800 particular Steve Hay has worked to side step many warnings emitted by their
801 compilers and at least one C compiler internal error.
803 Perl extensions on Windows now can be statically built into the Perl DLL,
804 thanks to a work by Vadim Konovalov.
806 =head2 New Or Improved Platforms
808 Perl is being ported to Symbian OS. See L<perlsymbian> for more
811 The VMS port has been improved. See L<perlvms>.
813 DynaLoader::dl_unload_file() now works on Windows.
815 Portability of Perl on various recent compilers on Windows has been
816 improved (Borland C++, Visual C++ 7.0).
818 =head2 Module auxiliary files
820 README files and changelogs for CPAN modules bundled with perl are no
823 =head1 Selected Bug Fixes
827 =item strictures in regexp-eval blocks
829 C<strict> wasn't in effect in regexp-eval blocks (C</(?{...})/>).
833 C<use strict "refs"> was ignoring taking a hard reference in an argument
834 to defined(), as in :
838 if (defined $$x) {...}
840 This now correctly produces the run-time error C<Can't use string as a
841 SCALAR ref while "strict refs" in use>.
843 =item Calling CORE::require()
845 CORE::require() and CORE::do() were always parsed as require() and do()
846 when they were overridden. This is now fixed.
848 =item Subscripts of slices
850 You can now use a non-arrowed form for chained subscripts after a list
853 ({foo => "bar"})[0]{foo}
855 This used to be a syntax error; a C<< -> >> was required.
857 =item C<no warnings 'category'> works correctly with -w
859 Previously when running with warnings enabled globally via C<-w>, selective
860 disabling of specific warning categories would actually turn off all warnings.
861 This is now fixed; now C<no warnings 'io';> will only turn off warnings in the
862 C<io> class. Previously it would erroneously turn off all warnings.
864 =item threads and memory usage
866 Several memory leaks in ithreads were closed. Also, ithreads were made
867 less memory-intensive.
869 =item chr() and negative values
871 chr() on a negative value now gives C<\x{FFFD}>, the Unicode replacement
872 character, unless when the C<bytes> pragma is in effect, where the low
873 eight bytes of the value are used.
877 =head1 New or Changed Diagnostics
881 =item Deprecated use of my() in false conditional
883 A new deprecation warning, I<Deprecated use of my() in false conditional>,
884 has been added, to warn against the use of the dubious and deprecated
889 See L<perldiag>. Use C<state> variables instead.
891 =item !=~ should be !~
893 A new warning, C<!=~ should be !~>, is emitted to prevent this misspelling
894 of the non-matching operator.
896 =item Newline in left-justified string
898 The warning I<Newline in left-justified string> has been removed.
900 =item Too late for "-T" option
902 The error I<Too late for "-T" option> has been reformulated to be more
905 =item "%s" variable %s masks earlier declaration
907 This warning is now emitted in more consistent cases; in short, when one
908 of the declarations involved is a C<my> variable:
910 my $x; my $x; # warns
911 my $x; our $x; # warns
912 our $x; my $x; # warns
914 On the other hand, the following:
918 now gives a C<"our" variable %s redeclared> warning.
920 =item readdir()/closedir()/etc. attempted on invalid dirhandle
922 These new warnings are now emitted when a dirhandle is used but is
923 either closed or not really a dirhandle.
927 C<perl -V> has several improvements, making it more useable from shell
928 scripts to get the value of configuration variables. See L<perlrun> for
933 =head1 Changed Internals
935 In general, the source code of perl has been refactored, tied up, and
936 optimized in many places. Also, memory management and allocation has been
937 improved in a couple of points.
939 =head2 Reordering of SVt_* constants
941 The relative ordering of constants that define the various types of C<SV>
942 have changed; in particular, C<SVt_PVGV> has been moved before C<SVt_PVLV>,
943 C<SVt_PVAV>, C<SVt_PVHV> and C<SVt_PVCV>. This is unlikely to make any
944 difference unless you have code that explicitly makes assumptions about that
945 ordering. (The inheritance hierarchy of C<B::*> objects has been changed
948 =head2 Removal of CPP symbols
950 The C preprocessor symbols C<PERL_PM_APIVERSION> and
951 C<PERL_XS_APIVERSION>, which were supposed to give the version number of
952 the oldest perl binary-compatible (resp. source-compatible) with the
953 present one, were not used, and sometimes had misleading values. They have
956 =head2 Less space is used by ops
958 The C<BASEOP> structure now uses less space. The C<op_seq> field has been
959 removed and replaced by the one-bit fields C<op_opt>. C<op_type> is now 9
960 bits long. (Consequently, the C<B::OP> class doesn't provide an C<seq>
965 perl's parser is now generated by bison (it used to be generated by
966 byacc.) As a result, it seems to be a bit more robust.
968 Also, Dave Mitchell improved the lexer debugging output under C<-DT>.
970 =head2 Use of C<const>
972 Andy Lester supplied many improvements to determine which function
973 parameters and local variables could actually be declared C<const> to the C
974 compiler. Steve Peters provided new C<*_set> macros and reworked the core to
975 use these rather than assigning to macros in LVALUE context.
979 A new file, F<mathoms.c>, has been added. It contains functions that are
980 no longer used in the perl core, but that remain available for binary or
981 source compatibility reasons. However, those functions will not be
982 compiled in if you add C<-DNO_MATHOMS> in the compiler flags.
984 =head2 C<AvFLAGS> has been removed
986 The C<AvFLAGS> macro has been removed.
988 =head2 C<av_*> changes
990 The C<av_*()> functions, used to manipulate arrays, no longer accept null
993 =head2 B:: modules inheritance changed
995 The inheritance hierarchy of C<B::> modules has changed; C<B::NV> now
996 inherits from C<B::SV> (it used to inherit from C<B::IV>).
1000 =head1 Known Problems
1002 There's still a remaining problem in the implementation of the lexical
1003 C<$_>: it doesn't work inside C</(?{...})/> blocks. (See the TODO test in
1006 =head1 Platform Specific Problems
1008 =head1 Reporting Bugs
1012 The F<Changes> file and the perl590delta to perl595delta man pages for
1013 exhaustive details on what changed.
1015 The F<INSTALL> file for how to build Perl.
1017 The F<README> file for general stuff.
1019 The F<Artistic> and F<Copying> files for copyright information.