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