926ba305309a4e646aadf15a0e13d48783e5edbd
[p5sagit/p5-mst-13.2.git] / pod / perl594delta.pod
1 =head1 NAME
2
3 perldelta - what is new for perl v5.9.4
4
5 =head1 DESCRIPTION
6
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.
10
11 =head1 Incompatible Changes
12
13 =head2 chdir FOO
14
15 A bareword argument to chdir() is now recognized as a file handle.
16 Earlier releases interpreted the bareword as a directory name.
17 (Gisle Aas)
18
19 =head2 Handling of pmc files
20
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.
25
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.)
29
30 =head2 @- and @+ in patterns
31
32 The special arrays C<@-> and C<@+> are no longer interpolated in regular
33 expressions. (Sadahiro Tomoyuki)
34
35 =head2 $AUTOLOAD can now be tainted
36
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.
39 (Rick Delaney)
40
41 =head1 Core Enhancements
42
43 =head2 state() variables
44
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)
50
51 To use state variables, one needs to enable them by using
52
53     use feature "state";
54
55 or by using the C<-E> command-line switch in one-liners.
56
57 See L<perlsub/"Persistent variables via state()">.
58
59 =head2 UNIVERSAL::DOES()
60
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)
66
67 See L<< UNIVERSAL/"$obj->DOES( ROLE )" >>.
68
69 =head2 Exceptions in constant folding
70
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.
74 (Nicholas Clark)
75
76 =head1 Modules and Pragmata
77
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)
81
82 C<threads>
83
84 =head2 New Core Modules
85
86 =over 4
87
88 =item *
89
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.
93
94 =item *
95
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.
98
99 =item *
100
101 C<Module::Load>, by Jos Boumans, has been added. It's used to load
102 indistinctively modules and files.
103
104 =item *
105
106 C<Module::Loaded>, by Jos Boumans, has been added. It's used to mark
107 modules as loaded or unloaded.
108
109 =item *
110
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.
113
114 =item *
115
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
118 files/dirs.
119
120 =back
121
122 =head1 Utility Changes
123
124 =head2 config_data
125
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.)
131
132 =head1 Documentation
133
134 =head2 New manpage, perlpragma
135
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
138 5.9.4).
139
140 =head2 New manpage, perlreguts
141
142 The L<perlreguts> manpage, due to Yves Orton, describes internals of the
143 Perl regular expression engine.
144
145 =head2 New manpage, perlunitut
146
147 The L<perlunitut> manpage is an tutorial for programming with Unicode and
148 string encodings in Perl, due to Juerd Waalboer.
149
150 =head1 Performance Enhancements
151
152 Several internal data structures (typeglobs, GVs, CVs, formats) have been
153 restructured to use less memory. (Nicholas Clark)
154
155 The UTF-8 caching code is now more efficient, and used more often.
156 (Nicholas Clark)
157
158 Regular expressions (Yves Orton) TODO
159
160 =head1 Installation and Configuration Improvements
161
162 =head2 Relocatable installations
163
164 TODO
165
166 =head2 Ports
167
168 Many improvements have been made towards making Perl work correctly on
169 z/OS.
170
171 Perl has been reported to work on DragonFlyBSD.
172
173 =head2 Compilation improvements
174
175 All F<ppport.h> files in the XS modules bundled with perl are now
176 autogenerated at build time. (Marcus Holland-Moritz)
177
178 =head2 New probes
179
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)
184
185 =head1 Selected Bug Fixes
186
187 =head2 PERL5SHELL and tainting
188
189 On Windows, PERL5SHELL is now checked for taintedness. (Rafael
190 Garcia-Suarez)
191
192 =head2 Using *FILE{IO}
193
194 C<stat()> and C<-X> filetests now treat *FILE{IO} filehandles like *FILE
195 filehandles. (Steve Peters)
196
197 =head2 Overloading and reblessing
198
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)
203
204 =head2 Overloading and UTF-8
205
206 A few bugs related to UTF-8 handling with objects that have
207 stringification overloaded have been fixed. (Nicholas Clark)
208
209 =head1 New or Changed Diagnostics
210
211 =over 4
212
213 =item State variable %s will be reinitialized
214
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>.
217
218 =back
219
220 =head1 Changed Internals
221
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.
226
227 =head1 Known Problems
228
229 One warning test (number 263 in F<lib/warnings.t>) fails under UTF-8
230 locales.
231
232 Bytecode tests fails under several platforms. Support for byteloader and
233 compiler is considered to be removed before the 5.10.0 release.
234
235 =head2 Platform-specific Problems
236
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.
239
240 =head1 Reporting Bugs
241
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.
246
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.
252
253 =head1 SEE ALSO
254
255 The F<Changes> file for exhaustive details on what changed.
256
257 The F<INSTALL> file for how to build Perl.
258
259 The F<README> file for general stuff.
260
261 The F<Artistic> and F<Copying> files for copyright information.
262
263 =cut