1PERL591DELTA(1)        Perl Programmers Reference Guide        PERL591DELTA(1)
2
3
4

NAME

6       perl591delta - what is new for perl v5.9.1
7

DESCRIPTION

9       This document describes differences between the 5.9.0 and the 5.9.1
10       development releases. See perl590delta for the differences between
11       5.8.0 and 5.9.0.
12

Incompatible Changes

14   substr() lvalues are no longer fixed-length
15       The lvalues returned by the three argument form of substr() used to be
16       a "fixed length window" on the original string. In some cases this
17       could cause surprising action at distance or other undefined behaviour.
18       Now the length of the window adjusts itself to the length of the string
19       assigned to it.
20
21   The ":unique" attribute is only meaningful for globals
22       Now applying ":unique" to lexical variables and to subroutines will
23       result in a compilation error.
24

Core Enhancements

26   Lexical $_
27       The default variable $_ can now be lexicalized, by declaring it like
28       any other lexical variable, with a simple
29
30           my $_;
31
32       The operations that default on $_ will use the lexically-scoped version
33       of $_ when it exists, instead of the global $_.
34
35       In a "map" or a "grep" block, if $_ was previously my'ed, then the $_
36       inside the block is lexical as well (and scoped to the block).
37
38       In a scope where $_ has been lexicalized, you can still have access to
39       the global version of $_ by using $::_, or, more simply, by overriding
40       the lexical declaration with "our $_".
41
42   Tied hashes in scalar context
43       As of perl 5.8.2/5.9.0, tied hashes did not return anything useful in
44       scalar context, for example when used as boolean tests:
45
46               if (%tied_hash) { ... }
47
48       The old nonsensical behaviour was always to return false, regardless of
49       whether the hash is empty or has elements.
50
51       There is now an interface for the implementors of tied hashes to
52       implement the behaviour of a hash in scalar context, via the SCALAR
53       method (see perltie).  Without a SCALAR method, perl will try to guess
54       whether the hash is empty, by testing if it's inside an iteration (in
55       this case it can't be empty) or by calling FIRSTKEY.
56
57   Formats
58       Formats were improved in several ways. A new field, "^*", can be used
59       for variable-width, one-line-at-a-time text. Null characters are now
60       handled correctly in picture lines. Using "@#" and "~~" together will
61       now produce a compile-time error, as those format fields are
62       incompatible.  perlform has been improved, and miscellaneous bugs
63       fixed.
64
65   Stacked filetest operators
66       As a new form of syntactic sugar, it's now possible to stack up
67       filetest operators. You can now write "-f -w -x $file" in a row to mean
68       "-x $file && -w _ && -f _". See "-X" in perlfunc.
69

Modules and Pragmata

71       Benchmark
72           In "Benchmark", cmpthese() and timestr() now use the time
73           statistics of children instead of parent when the selected style is
74           'nop'.
75
76       Carp
77           The error messages produced by "Carp" now include spaces between
78           the arguments in function argument lists: this makes long error
79           messages appear more nicely in browsers and other tools.
80
81       Exporter
82           "Exporter" will now recognize grouping tags (such as ":name")
83           anywhere in the import list, not only at the beginning.
84
85       FindBin
86           A function "again" is provided to resolve problems where modules in
87           different directories wish to use FindBin.
88
89       List::Util
90           You can now weaken references to read only values.
91
92       threads::shared
93           "cond_wait" has a new two argument form. "cond_timedwait" has been
94           added.
95

Utility Changes

97       "find2perl" now assumes "-print" as a default action. Previously, it
98       needed to be specified explicitly.
99
100       A new utility, "prove", makes it easy to run an individual regression
101       test at the command line. "prove" is part of Test::Harness, which users
102       of earlier Perl versions can install from CPAN.
103
104       The perl debugger now supports a "save" command, to save the current
105       history to a file, and an "i" command, which prints the inheritance
106       tree of its argument (if the "Class::ISA" module is installed.)
107

Documentation

109       The documentation has been revised in places to produce more standard
110       manpages.
111
112       The long-existing feature of "/(?{...})/" regexps setting $_ and pos()
113       is now documented.
114

Performance Enhancements

116       Sorting arrays in place ("@a = sort @a") is now optimized to avoid
117       making a temporary copy of the array.
118
119       The operations involving case mapping on UTF-8 strings (uc(), lc(),
120       "//i", etc.) have been greatly speeded up.
121
122       Access to elements of lexical arrays via a numeric constant between 0
123       and 255 is now faster. (This used to be only the case for global
124       arrays.)
125

Selected Bug Fixes

127   UTF-8 bugs
128       Using substr() on a UTF-8 string could cause subsequent accesses on
129       that string to return garbage. This was due to incorrect UTF-8 offsets
130       being cached, and is now fixed.
131
132       join() could return garbage when the same join() statement was used to
133       process 8 bit data having earlier processed UTF-8 data, due to the
134       flags on that statement's temporary workspace not being reset
135       correctly. This is now fixed.
136
137       Using Unicode keys with tied hashes should now work correctly.
138
139       chop() and chomp() used to mangle UTF-8 strings.  This has been fixed.
140
141       sprintf() used to misbehave when the format string was in UTF-8. This
142       is now fixed.
143
144   Threading bugs
145       Hashes with the ":unique" attribute weren't made read-only in new
146       threads. They are now.
147
148   More bugs
149       "$a .. $b" will now work as expected when either $a or $b is "undef".
150
151       Reading $^E now preserves $!. Previously, the C code implementing $^E
152       did not preserve "errno", so reading $^E could cause "errno" and
153       therefore $! to change unexpectedly.
154
155       "strict" wasn't in effect in regexp-eval blocks ("/(?{...})/").
156

New or Changed Diagnostics

158       A new deprecation warning, Deprecated use of my() in false conditional,
159       has been added, to warn against the use of the dubious and deprecated
160       construct
161
162           my $x if 0;
163
164       See perldiag.
165
166       The fatal error DESTROY created new reference to dead object is now
167       documented in perldiag.
168
169       A new error, %ENV is aliased to %s, is produced when taint checks are
170       enabled and when *ENV has been aliased (and thus doesn't reflect the
171       program's environment anymore.)
172

Changed Internals

174       These news matter to you only if you either write XS code or like to
175       know about or hack Perl internals (using Devel::Peek or any of the
176       "B::" modules counts), or like to run Perl with the "-D" option.
177
178   Reordering of SVt_* constants
179       The relative ordering of constants that define the various types of
180       "SV" have changed; in particular, "SVt_PVGV" has been moved before
181       "SVt_PVLV", "SVt_PVAV", "SVt_PVHV" and "SVt_PVCV".  This is unlikely to
182       make any difference unless you have code that explicitly makes
183       assumptions about that ordering. (The inheritance hierarchy of "B::*"
184       objects has been changed to reflect this.)
185
186   Removal of CPP symbols
187       The C preprocessor symbols "PERL_PM_APIVERSION" and
188       "PERL_XS_APIVERSION", which were supposed to give the version number of
189       the oldest perl binary-compatible (resp. source-compatible) with the
190       present one, were not used, and sometimes had misleading values. They
191       have been removed.
192
193   Less space is used by ops
194       The "BASEOP" structure now uses less space. The "op_seq" field has been
195       removed and replaced by two one-bit fields, "op_opt" and "op_static".
196       "opt_type" is now 9 bits long. (Consequently, the "B::OP" class doesn't
197       provide an "seq" method anymore.)
198
199   New parser
200       perl's parser is now generated by bison (it used to be generated by
201       byacc.) As a result, it seems to be a bit more robust.
202

Configuration and Building

204       "Configure" now invokes callbacks regardless of the value of the
205       variable they are called for. Previously callbacks were only invoked in
206       the "case $variable $define)" branch. This change should only affect
207       platform maintainers writing configuration hints files.
208
209       The portability and cleanliness of the Win32 makefiles has been
210       improved.
211

Known Problems

213       There are still a couple of problems in the implementation of the
214       lexical $_: it doesn't work inside "/(?{...})/" blocks and with regard
215       to the reverse() built-in used without arguments. (See the TODO tests
216       in t/op/mydef.t.)
217
218   Platform Specific Problems
219       The test ext/IPC/SysV/t/ipcsysv.t may fail on OpenBSD. This hasn't been
220       diagnosed yet.
221
222       On some configurations on AIX 5, one test in lib/Time/Local.t fails.
223       When configured with long doubles, perl may fail tests 224-236 in
224       t/op/pow.t on the same platform.
225
226       For threaded builds, ext/threads/shared/t/wait.t has been reported to
227       fail some tests on HP-UX 10.20.
228

To-do for perl 5.10.0

230       This is a non-exhaustive, non-ordered, non-contractual and non-
231       definitive list of things to do (or nice to have) for perl 5.10.0 :
232
233       Clean up and finish support for assertions. See assertions.
234
235       Reimplement the mechanism of lexical pragmas to be more extensible. Fix
236       current pragmas that don't work well (or at all) with lexical scopes or
237       in run-time eval(STRING) ("sort", "re", "encoding" for example). MJD
238       has a preliminary patch that implements this.
239
240       Fix (or rewrite) the implementation of the "/(?{...})/" closures.
241
242       Conversions from byte strings to UTF-8 currently map high bit
243       characters to Unicode without translation (or, depending on how you
244       look at it, by implicitly assuming that the byte strings are in
245       Latin-1). As perl assumes the C locale by default, upgrading a string
246       to UTF-8 may change the meaning of its contents regarding character
247       classes, case mapping, etc.  This should probably emit a warning (at
248       least).
249
250       Introduce a new special block, UNITCHECK, which is run at the end of a
251       compilation unit (module, file, eval(STRING) block). This will
252       correspond to the Perl 6 CHECK. Perl 5's CHECK cannot be changed or
253       removed because the O.pm/B.pm backend framework depends on it.
254
255       Study the possibility of adding a new prototype character, "_", meaning
256       "this argument defaults to $_".
257
258       Make the peephole optimizer optional.
259
260       Allow lexical aliases (maybe via the syntax "my \$alias = \$foo".
261
262       Fix the bugs revealed by running the test suite with the "-t" switch
263       (via "make test.taintwarn").
264
265       Make threads more robust.
266
267       Make "no 6" and "no v6" work (opposite of "use 5.005", etc.).
268
269       A test suite for the B module would be nice.
270
271       A ponie.
272

Reporting Bugs

274       If you find what you think is a bug, you might check the articles
275       recently posted to the comp.lang.perl.misc newsgroup and the perl bug
276       database at http://bugs.perl.org/ .  There may also be information at
277       http://www.perl.org/ , the Perl Home Page.
278
279       If you believe you have an unreported bug, please run the perlbug
280       program included with your release.  Be sure to trim your bug down to a
281       tiny but sufficient test case.  Your bug report, along with the output
282       of "perl -V", will be sent off to perlbug@perl.org to be analysed by
283       the Perl porting team.
284

SEE ALSO

286       The Changes file for exhaustive details on what changed.
287
288       The INSTALL file for how to build Perl.
289
290       The README file for general stuff.
291
292       The Artistic and Copying files for copyright information.
293
294
295
296perl v5.10.1                      2009-02-12                   PERL591DELTA(1)
Impressum