1PERL594DELTA(1) Perl Programmers Reference Guide PERL594DELTA(1)
2
3
4
6 perl594delta - what is new for perl v5.9.4
7
9 This document describes differences between the 5.9.3 and the 5.9.4
10 development releases. See perl590delta, perl591delta, perl592delta and
11 perl593delta for the differences between 5.8.0 and 5.9.3.
12
14 chdir FOO
15 A bareword argument to chdir() is now recognized as a file handle.
16 Earlier releases interpreted the bareword as a directory name. (Gisle
17 Aas)
18
19 Handling of pmc files
20 An old feature of perl was that before "require" or "use" look for a
21 file with a .pm extension, they will first look for a similar filename
22 with a .pmc extension. If this file is found, it will be loaded in
23 place of any potentially existing file ending in a .pm extension.
24
25 Previously, .pmc files were loaded only if more recent than the
26 matching .pm file. Starting with 5.9.4, they'll be always loaded if
27 they exist. (This trick is used by Pugs.)
28
29 @- and @+ in patterns
30 The special arrays "@-" and "@+" are no longer interpolated in regular
31 expressions. (Sadahiro Tomoyuki)
32
33 $AUTOLOAD can now be tainted
34 If you call a subroutine by a tainted name, and if it defers to an
35 AUTOLOAD function, then $AUTOLOAD will be (correctly) tainted. (Rick
36 Delaney)
37
39 state() variables
40 A new class of variables has been introduced. State variables are
41 similar to "my" variables, but are declared with the "state" keyword in
42 place of "my". They're visible only in their lexical scope, but their
43 value is persistent: unlike "my" variables, they're not undefined at
44 scope entry, but retain their previous value. (Rafael Garcia-Suarez)
45
46 To use state variables, one needs to enable them by using
47
48 use feature "state";
49
50 or by using the "-E" command-line switch in one-liners.
51
52 See "Persistent variables via state()" in perlsub.
53
54 UNIVERSAL::DOES()
55 The "UNIVERSAL" class has a new method, "DOES()". It has been added to
56 solve semantic problems with the "isa()" method. "isa()" checks for
57 inheritance, while "DOES()" has been designed to be overridden when
58 module authors use other types of relations between classes (in
59 addition to inheritance). (chromatic)
60
61 See "$obj->DOES( ROLE )" in UNIVERSAL.
62
63 Exceptions in constant folding
64 The constant folding routine is now wrapped in an exception handler,
65 and if folding throws an exception (such as attempting to evaluate
66 0/0), perl now retains the current optree, rather than aborting the
67 whole program. (Nicholas Clark, Dave Mitchell)
68
69 Source filters in @INC
70 It's possible to enhance the mechanism of subroutine hooks in @INC by
71 adding a source filter on top of the filehandle opened and returned by
72 the hook. This feature was planned a long time ago, but wasn't quite
73 working until now. See "require" in perlfunc for details. (Nicholas
74 Clark)
75
76 MAD
77 MAD, which stands for Misc Attribute Decoration, is a still-in-
78 development work leading to a Perl 5 to Perl 6 converter. To enable it,
79 it's necessary to pass the argument "-Dmad" to Configure. The obtained
80 perl isn't binary compatible with a regular perl 5.9.4, and has space
81 and speed penalties; moreover not all regression tests still pass with
82 it. (Larry Wall, Nicholas Clark)
83
85 · "encoding::warnings" is now a lexical pragma. (Although on older
86 perls, which don't have support for lexical pragmas, it keeps its
87 global behaviour.) (Audrey Tang)
88
89 · "threads" is now a dual-life module, also available on CPAN. It has
90 been expanded in many ways. A kill() method is available for thread
91 signalling. One can get thread status, or the list of running or
92 joinable threads.
93
94 A new "threads->exit()" method is used to exit from the application
95 (this is the default for the main thread) or from the current
96 thread only (this is the default for all other threads). On the
97 other hand, the exit() built-in now always causes the whole
98 application to terminate. (Jerry D. Hedden)
99
100 New Core Modules
101 · "Hash::Util::FieldHash", by Anno Siegel, has been added. This
102 module provides support for field hashes: hashes that maintain an
103 association of a reference with a value, in a thread-safe garbage-
104 collected way. Such hashes are useful to implement inside-out
105 objects.
106
107 · "Module::Build", by Ken Williams, has been added. It's an
108 alternative to "ExtUtils::MakeMaker" to build and install perl
109 modules.
110
111 · "Module::Load", by Jos Boumans, has been added. It provides a
112 single interface to load Perl modules and .pl files.
113
114 · "Module::Loaded", by Jos Boumans, has been added. It's used to mark
115 modules as loaded or unloaded.
116
117 · "Package::Constants", by Jos Boumans, has been added. It's a simple
118 helper to list all constants declared in a given package.
119
120 · "Win32API::File", by Tye McQueen, has been added (for Windows
121 builds). This module provides low-level access to Win32 system API
122 calls for files/dirs.
123
125 config_data
126 "config_data" is a new utility that comes with "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 *::ConfigData modules that contain local configuration information for
130 their parent modules.)
131
133 New manpage, perlpragma
134 The perlpragma manpage documents how to write one's own lexical pragmas
135 in pure Perl (something that is possible starting with 5.9.4).
136
137 New manpage, perlreguts
138 The perlreguts manpage, courtesy of Yves Orton, describes internals of
139 the Perl regular expression engine.
140
141 New manpage, perlunitut
142 The perlunitut manpage is an tutorial for programming with Unicode and
143 string encodings in Perl, courtesy of Juerd Waalboer.
144
146 Memory optimisations
147 Several internal data structures (typeglobs, GVs, CVs, formats) have
148 been restructured to use less memory. (Nicholas Clark)
149
150 UTF-8 cache optimisation
151 The UTF-8 caching code is now more efficient, and used more often.
152 (Nicholas Clark)
153
154 Regular expressions
155 Engine de-recursivised
156 The regular expression engine is no longer recursive, meaning that
157 patterns that used to overflow the stack will either die with
158 useful explanations, or run to completion, which, since they were
159 able to blow the stack before, will likely take a very long time to
160 happen. If you were experiencing the occasional stack overflow (or
161 segfault) and upgrade to discover that now perl apparently hangs
162 instead, look for a degenerate regex. (Dave Mitchell)
163
164 Single char char-classes treated as literals
165 Classes of a single character are now treated the same as if the
166 character had been used as a literal, meaning that code that uses
167 char-classes as an escaping mechanism will see a speedup. (Yves
168 Orton)
169
170 Trie optimisation of literal string alternations
171 Alternations, where possible, are optimised into more efficient
172 matching structures. String literal alternations are merged into a
173 trie and are matched simultaneously. This means that instead of
174 O(N) time for matching N alternations at a given point the new code
175 performs in O(1) time. (Yves Orton)
176
177 Note: Much code exists that works around perl's historic poor
178 performance on alternations. Often the tricks used to do so will
179 disable the new optimisations. Hopefully the utility modules used
180 for this purpose will be educated about these new optimisations by
181 the time 5.10 is released.
182
183 Aho-Corasick start-point optimisation
184 When a pattern starts with a trie-able alternation and there aren't
185 better optimisations available the regex engine will use Aho-
186 Corasick matching to find the start point. (Yves Orton)
187
188 Sloppy stat on Windows
189 On Windows, perl's stat() function normally opens the file to determine
190 the link count and update attributes that may have been changed through
191 hard links. Setting ${^WIN32_SLOPPY_STAT} to a true value speeds up
192 stat() by not performing this operation. (Jan Dubois)
193
195 Relocatable installations
196 There is now Configure support for creating a relocatable perl tree. If
197 you Configure with "-Duserelocatableinc", then the paths in @INC (and
198 everything else in %Config) can be optionally located via the path of
199 the perl executable.
200
201 That means that, if the string ".../" is found at the start of any
202 path, it's substituted with the directory of $^X. So, the relocation
203 can be configured on a per-directory basis, although the default with
204 "-Duserelocatableinc" is that everything is relocated. The initial
205 install is done to the original configured prefix.
206
207 Ports
208 Many improvements have been made towards making Perl work correctly on
209 z/OS.
210
211 Perl has been reported to work on DragonFlyBSD.
212
213 Compilation improvements
214 All ppport.h files in the XS modules bundled with perl are now
215 autogenerated at build time. (Marcus Holland-Moritz)
216
217 New probes
218 The configuration process now detects whether strlcat() and strlcpy()
219 are available. When they are not available, perl's own version is used
220 (from Russ Allbery's public domain implementation). Various places in
221 the perl interpreter now use them. (Steve Peters)
222
223 Windows build improvements
224 Building XS extensions
225 Support for building XS extension modules with the free MinGW
226 compiler has been improved in the case where perl itself was built
227 with the Microsoft VC++ compiler. (ActiveState)
228
229 Support for 64-bit compiler
230 Support for building perl with Microsoft's 64-bit compiler has been
231 improved. (ActiveState)
232
234 PERL5SHELL and tainting
235 On Windows, the PERL5SHELL environment variable is now checked for
236 taintedness. (Rafael Garcia-Suarez)
237
238 Using *FILE{IO}
239 "stat()" and "-X" filetests now treat *FILE{IO} filehandles like *FILE
240 filehandles. (Steve Peters)
241
242 Overloading and reblessing
243 Overloading now works when references are reblessed into another class.
244 Internally, this has been implemented by moving the flag for
245 "overloading" from the reference to the referent, which logically is
246 where it should always have been. (Nicholas Clark)
247
248 Overloading and UTF-8
249 A few bugs related to UTF-8 handling with objects that have
250 stringification overloaded have been fixed. (Nicholas Clark)
251
252 eval memory leaks fixed
253 Traditionally, "eval 'syntax error'" has leaked badly. Many (but not
254 all) of these leaks have now been eliminated or reduced. (Dave
255 Mitchell)
256
257 Random device on Windows
258 In previous versions, perl would read the file /dev/urandom if it
259 existed when seeding its random number generator. That file is
260 unlikely to exist on Windows, and if it did would probably not contain
261 appropriate data, so perl no longer tries to read it on Windows. (Alex
262 Davies)
263
265 State variable %s will be reinitialized
266 One can assign initial values to state variables, but not when
267 they're declared as a sub-part of a list assignment. See perldiag.
268
270 A new file, mathoms.c, contains functions that aren't used anymore in
271 the perl core, but remain around because modules out there might still
272 use them. They come from a factorization effort: for example, many PP
273 functions are now shared for several ops.
274
275 The implementation of the special variables $^H and %^H has changed, to
276 allow implementing lexical pragmas in pure perl.
277
279 One warning test (number 263 in lib/warnings.t) fails under UTF-8
280 locales.
281
282 Bytecode tests fail under several platforms. We are considering
283 removing support for byteloader and compiler before the 5.10.0 release.
284
286 If you find what you think is a bug, you might check the articles
287 recently posted to the comp.lang.perl.misc newsgroup and the perl bug
288 database at http://rt.perl.org/rt3/ . There may also be information at
289 http://www.perl.org/ , the Perl Home Page.
290
291 If you believe you have an unreported bug, please run the perlbug
292 program included with your release. Be sure to trim your bug down to a
293 tiny but sufficient test case. Your bug report, along with the output
294 of "perl -V", will be sent off to perlbug@perl.org to be analysed by
295 the Perl porting team.
296
298 The Changes file for exhaustive details on what changed.
299
300 The INSTALL file for how to build Perl.
301
302 The README file for general stuff.
303
304 The Artistic and Copying files for copyright information.
305
306
307
308perl v5.12.4 2011-06-01 PERL594DELTA(1)