3 perldelta - what is new for perl v5.9.4
7 This document describes differences between the 5.9.3 and the 5.9.4
8 developement releases. See L<perl590delta>, L<perl591delta>, L<perl592delta>
9 and L<perl593delta> for the differences between 5.8.0 and 5.9.3.
11 =head1 Incompatible Changes
15 A bareword argument to chdir() is now recognized as a file handle.
16 Earlier releases interpreted the bareword as a directory name.
19 =head2 Handling of pmc files
21 And old feature of perl is that before C<require> or C<use> look for a
22 file with a F<.pm> extension, they will first look for a similar filename
23 with a F<.pmc> extension. If this file is found, it will be loaded in
24 place of any potentially existing file ending in a F<.pm> extension.
26 Previously, F<.pmc> files were loaded only if more recent than the
27 matching F<.pm> file. Starting with 5.9.4, they'll be always loaded if
28 they exist. (This trick is used by Pugs.)
30 =head2 @- and @+ in patterns
32 The special arrays C<@-> and C<@+> are no longer interpolated in regular
33 expressions. (Sadahiro Tomoyuki)
35 =head2 $AUTOLOAD can now be tainted
37 If you call a subroutine by a tainted name, and if it defers to an
38 AUTOLOAD function, then $AUTOLOAD will be (correctly) tainted.
41 =head1 Core Enhancements
43 =head2 state() variables
45 A new class of variables has been introduced. State variables are similar
46 to C<my> variables, but are declared with the C<state> keyword in place of
47 C<my>. They're visible only in their lexical scope, but their value in
48 persistent: unlike C<my> variables, they're not undefined at scope entry,
49 and retain their previous value. (Rafael Garcia-Suarez)
51 To use state variables, one needs to enable them by using
55 or by using the C<-E> command-line switch in one-liners.
57 See L<perlsub/"Persistent variables via state()">.
59 =head2 UNIVERSAL::DOES()
61 The C<UNIVERSAL> class has a new method, C<DOES()>. It has been added to
62 solve semantic problems with the C<isa()> method. C<isa()> checks for
63 inheritance, while C<DOES()> has been designed to be overriden when
64 module authors use other types of relations between classes (in addition
65 to inheritance). (chromatic)
67 See L<< UNIVERSAL/"$obj->DOES( ROLE )" >>.
69 =head2 Exceptions in constant folding
71 The constant folding routine is now wrapped in an exception handler, and
72 if folding throws an exception (such as attempting to evaluate 0/0), perl
73 now retains the current optree, rather than aborting the whole program.
76 =head1 Modules and Pragmata
78 C<encoding::warnings> is now a lexical pragma. (Although on older perls,
79 which don't have support for lexical pragmas, it keeps its global
80 behaviour.) (Audrey Tang)
84 =head2 New Core Modules
90 C<Hash::Util::FieldHash>, by Anno Siegel, has been added. This module
91 provides support for I<field hashes>: hashes that maintain an association
92 of a reference with a value, in a thread-safe garbage-collected way.
96 C<Module::Build>, by Ken Williams, has been added. It's an alternative to
97 C<ExtUtils::MakeMaker> to build and install perl modules.
101 C<Module::Load>, by Jos Boumans, has been added. It's used to load
102 indistinctively modules and files.
106 C<Module::Loaded>, by Jos Boumans, has been added. It's used to mark
107 modules as loaded or unloaded.
111 C<Package::Constants>, by Jos Boumans, has been added. It's a simple
112 helper to list all constants declared in a given package.
116 C<Win32API::File>, by Tye McQueen, has been added (for Windows builds).
117 This module provides low-level access to Win32 system API calls for
122 =head1 Utility Changes
126 C<config_data> is a new utility that comes with C<Module::Build>. It
127 provides a command-line interface to the configuration of Perl modules
128 that use Module::Build's framework of configurability (that is,
129 C<*::ConfigData> modules, that contain local configuration information for
130 their parent modules.)
134 =head2 New manpage, perlpragma
136 The L<perlpragma> manpage documents how to write one's own lexical
137 pragmas in pure Perl (something that is possible only starting with
140 =head2 New manpage, perlreguts
142 The L<perlreguts> manpage, due to Yves Orton, describes internals of the
143 Perl regular expression engine.
145 =head2 New manpage, perlunitut
147 The L<perlunitut> manpage is an tutorial for programming with Unicode and
148 string encodings in Perl, due to Juerd Waalboer.
150 =head1 Performance Enhancements
152 Several internal data structures (typeglobs, GVs, CVs, formats) have been
153 restructured to use less memory. (Nicholas Clark)
155 The UTF-8 caching code is now more efficient, and used more often.
158 Regular expressions (Yves Orton) TODO
160 =head1 Installation and Configuration Improvements
162 =head2 Relocatable installations
168 Many improvements have been made towards making Perl work correctly on
171 Perl has been reported to work on DragonFlyBSD.
173 =head2 Compilation improvements
175 All F<ppport.h> files in the XS modules bundled with perl are now
176 autogenerated at build time. (Marcus Holland-Moritz)
180 The configuration process now detects whether strlcat() and strlcpy() are
181 available. When they are not available, perl's own version is used (from
182 Russ Allbery's public domain implementation). Various places in the perl
183 interpreter now uses them. (Steve Peters)
185 =head1 Selected Bug Fixes
187 =head2 PERL5SHELL and tainting
189 On Windows, PERL5SHELL is now checked for taintedness. (Rafael
192 =head2 Using *FILE{IO}
194 C<stat()> and C<-X> filetests now treat *FILE{IO} filehandles like *FILE
195 filehandles. (Steve Peters)
197 =head2 Overloading and reblessing
199 Overloading now works when references are reblessed into another class.
200 Internally, this has been implemented by moving the flag for "overloading"
201 from the reference to the referent, which logically is where it should
202 always have been. (Nicholas Clark)
204 =head2 Overloading and UTF-8
206 A few bugs related to UTF-8 handling with objects that have
207 stringification overloaded have been fixed. (Nicholas Clark)
209 =head1 New or Changed Diagnostics
213 =item State variable %s will be reinitialized
215 One can assign initial values to state variables, but not when they're
216 declared as a sub-part of a list assignment. See L<perldiag>.
220 =head1 Changed Internals
222 A new file, F<mathoms.c>, contains functions that aren't used anymore in
223 the perl core, but that remain around because modules out there might
224 still use them. They come from a factorization effort: for example, many
225 PP functions are now shared for several ops.
227 =head1 Known Problems
229 One warning test (number 263 in F<lib/warnings.t>) fails under UTF-8
232 Bytecode tests fails under several platforms. Support for byteloader and
233 compiler is considered to be removed before the 5.10.0 release.
235 =head2 Platform-specific Problems
237 The test F<ext/Socket/t/socketpair.t> crashes after completing all tests
238 successfully when built with USE_ITHREADS and PERL_IMPLICIT_SYS on Win32.
240 =head1 Reporting Bugs
242 If you find what you think is a bug, you might check the articles
243 recently posted to the comp.lang.perl.misc newsgroup and the perl
244 bug database at http://rt.perl.org/rt3/ . There may also be
245 information at http://www.perl.org/ , the Perl Home Page.
247 If you believe you have an unreported bug, please run the B<perlbug>
248 program included with your release. Be sure to trim your bug down
249 to a tiny but sufficient test case. Your bug report, along with the
250 output of C<perl -V>, will be sent off to perlbug@perl.org to be
251 analysed by the Perl porting team.
255 The F<Changes> file for exhaustive details on what changed.
257 The F<INSTALL> file for how to build Perl.
259 The F<README> file for general stuff.
261 The F<Artistic> and F<Copying> files for copyright information.