52b54fd7512d72921140c3b2c50c2d13fe04a25c
[p5sagit/p5-mst-13.2.git] / pod / perl591delta.pod
1 =head1 NAME
2
3 perldelta - what is new for perl v5.9.1
4
5 =head1 DESCRIPTION
6
7 This document describes differences between the 5.9.0 release and
8 the 5.9.1 release.
9
10 =head1 Incompatible Changes
11
12 =head1 Core Enhancements
13
14 =head2 Tied hashes in scalar context
15
16 As of perl 5.8.2, tied hashes did not return anything useful in scalar
17 context, for example when used as boolean tests:
18
19         if (%tied_hash) { ... }
20
21 The old nonsensical behaviour was always to return false,
22 regardless of whether the hash is empty or has elements.
23
24 There is now an interface for the implementors of tied hashes to implement
25 the behaviour of a hash in scalar context, via the SCALAR method (see
26 L<perltie>).  Without a SCALAR method, perl will try to guess whether
27 the hash is empty, by testing if it's inside an iteration (in this case
28 it can't be empty) or by calling FIRSTKEY.
29
30 =head2 Formats
31
32 Formats were improved in several ways. A new field, C<^*>, can be used for
33 variable-width, one-line-at-a-time text. Null characters are now handled
34 correctly in picture lines. Using C<@#> and C<~~> together will now
35 produce a compile-time error, as those format fields are incompatible.
36 L<perlform> has been improved, and miscellaneous bugs fixed.
37
38 =head2 The C<:unique> attribute is only meaningful for globals
39
40 Now applying C<:unique> to lexical variables and to subroutines will
41 result in a compilation error.
42
43 =head1 Modules and Pragmata
44
45 =over 4
46
47 =item Carp
48
49 The error messages produced by C<Carp> now include spaces between the
50 arguments in function argument lists: this makes long error messages
51 appear more nicely in browsers and other tools.
52
53 =item Exporter
54
55 C<Exporter> will now recognize grouping tags (such as C<:name>) anywhere
56 in the import list, not only at the beginning.
57
58 =item FindBin
59
60 A function C<again> is provided to resolve problems where modules in different
61 directories wish to use FindBin.
62
63 =item List::Util
64
65 You can now weaken references to read only values.
66
67 =item threads::shared
68
69 C<cond_wait> has a new two argument form. C<cond_timedwait> has been added.
70
71 =back
72
73 =head1 Utility Changes
74
75 C<find2perl> now assumes C<-print> as a default action. Previously, it
76 needed to be specified explicitly.
77
78 A new utility, C<prove>, makes it easy to run an individual regression test
79 at the command line. C<prove> is part of Test::Harness, which users of earlier
80 Perl versions can install from CPAN.
81
82 =head1 Documentation
83
84 The documentation has been revised in places to produce more standard manpages.
85
86 The long-existing feature of C</(?{...})/> regexps setting C<$_> and pos()
87 is now documented.
88
89 =head1 Performance Enhancements
90
91 =head1 Installation and Configuration Improvements
92
93 =head1 Selected Bug Fixes
94
95 =head2 UTF8 bugs
96
97 Using substr() on a UTF8 string could cause subsequent accesses on that
98 string to return garbage. This was due to incorrect UTF8 offsets being
99 cached, and is now fixed.
100
101 join() could return garbage when the same join() statement was used to
102 process 8 bit data having earlier processed UTF8 data, due to the flags
103 on that statement's temporary workspace not being reset correctly. This
104 is now fixed.
105
106 Using Unicode keys with tied hashes should now work correctly.
107
108 chop() and chomp() used to mangle UTF8 strings.  This has been fixed.
109
110 =head2 Threading bugs
111
112 Hashes with the C<:unique> attribute weren't made read-only in new
113 threads. They are now.
114
115 =head2 More bugs
116
117 C<$a .. $b> will now work as expected when either $a or $b is C<undef>
118
119 Reading $^E now preserves $!. Previously, the C code implementing $^E
120 did not preserve C<errno>, so reading $^E could cause C<errno> and therefore
121 C<$!> to change unexpectedly.
122
123 Reentrant functions will (once more) work with C++. 5.8.2 introduced a bugfix
124 which accidentally broke the compilation of Perl extensions written in C++
125
126 =head1 New or Changed Diagnostics
127
128 The fatal error "DESTROY created new reference to dead object" is now
129 documented in L<perldiag>.
130
131 A new error, "%ENV is aliased to %s", is produced when taint checks are
132 enabled and when *ENV has been aliased (and thus doesn't reflect the
133 program's environment anymore.)
134
135 =head1 Changed Internals
136
137 =head1 Configuration and Building
138
139 C<Configure> now invokes callbacks regardless of the value of the variable
140 they are called for. Previously callbacks were only invoked in the
141 C<case $variable $define)> branch. This change should only affect platform
142 maintainers writing configuration hints files.
143
144 =head1 New Tests
145
146 =head1 Known Problems
147
148 =head1 Platform Specific Problems
149
150 =head1 Reporting Bugs
151
152 If you find what you think is a bug, you might check the articles
153 recently posted to the comp.lang.perl.misc newsgroup and the perl
154 bug database at http://bugs.perl.org/ .  There may also be
155 information at http://www.perl.com/ , the Perl Home Page.
156
157 If you believe you have an unreported bug, please run the B<perlbug>
158 program included with your release.  Be sure to trim your bug down
159 to a tiny but sufficient test case.  Your bug report, along with the
160 output of C<perl -V>, will be sent off to perlbug@perl.org to be
161 analysed by the Perl porting team.
162
163 =head1 SEE ALSO
164
165 The F<Changes> file for exhaustive details on what changed.
166
167 The F<INSTALL> file for how to build Perl.
168
169 The F<README> file for general stuff.
170
171 The F<Artistic> and F<Copying> files for copyright information.
172
173 =cut