Downconst external APIs
[p5sagit/p5-mst-13.2.git] / pod / perl592delta.pod
CommitLineData
e0eb806d 1=head1 NAME
2
3perldelta - what is new for perl v5.9.2
4
5=head1 DESCRIPTION
6
7This document describes differences between the 5.9.1 and the 5.9.2
fa11829f 8development releases. See L<perl590delta> and L<perl591delta> for the
e0eb806d 9differences between 5.8.0 and 5.9.1.
10
11=head1 Incompatible Changes
12
a8cf0b1d 13=head2 Packing and UTF-8 strings
14
15The semantics of pack() and unpack() regarding UTF-8-encoded data has been
f1aa04aa 16changed. Processing is now by default character per character instead of
17byte per byte on the underlying encoding. Notably, code that used things
18like C<pack("a*", $string)> to see through the encoding of string will now
19simply get back the original $string. Packed strings can also get upgraded
20during processing when you store upgraded characters. You can get the old
21behaviour by using C<use bytes>.
a8cf0b1d 22
23To be consistent with pack(), the C<C0> in unpack() templates indicates
24that the data is to be processed in character mode, i.e. character by
25character; at the contrary, C<U0> in unpack() indicates UTF-8 mode, where
26the packed string is processed in its UTF-8-encoded Unicode form on a byte
27by byte basis. This is reversed with regard to perl 5.8.X.
28
29Moreover, C<C0> and C<U0> can also be used in pack() templates to specify
30respectively character and byte modes.
31
f1aa04aa 32C<C0> and C<U0> in the middle of a pack or unpack format now switch to the
33specified encoding mode, honoring parens grouping. Previously, parens were
34ignored.
a8cf0b1d 35
36Also, there is a new pack() character format, C<W>, which is intended to
f1aa04aa 37replace the old C<C>. C<C> is kept for unsigned chars coded as bytes in
38the strings internal representation. C<W> represents unsigned (logical)
39character values, which can be greater than 255. It is therefore more
40robust when dealing with potentially UTF-8-encoded data (as C<C> will wrap
41values outside the range 0..255, and not respect the string encoding).
a8cf0b1d 42
43In practice, that means that pack formats are now encoding-neutral, except
44C<C>.
45
1cdd6bcc 46For consistency, C<A> in unpack() format now trims all Unicode whitespace
47from the end of the string. Before perl 5.9.2, it used to strip only the
48classical ASCII space characters.
49
1af60bcb 50=head2 Miscellaneous
3911fe8f 51
1af60bcb 52The internal dump output has been improved, so that non-printable characters
53such as newline and backspace are output in C<\x> notation, rather than
54octal.
55
56The B<-C> option can no longer be used on the C<#!> line. It wasn't
57working anyway.
3911fe8f 58
e0eb806d 59=head1 Core Enhancements
60
1af60bcb 61=head2 Malloc wrapping
1cdd6bcc 62
1af60bcb 63Perl can now be built to detect attempts to assign pathologically large chunks
64of memory. Previously such assignments would suffer from integer wrap-around
65during size calculations causing a misallocation, which would crash perl, and
66could theoretically be used for "stack smashing" attacks. The wrapping
67defaults to enabled on platforms where we know it works (most AIX
68configurations, BSDi, Darwin, DEC OSF/1, FreeBSD, HP/UX, GNU Linux, OpenBSD,
69Solaris, VMS and most Win32 compilers) and defaults to disabled on other
70platforms.
71
72=head2 Unicode Character Database 4.0.1
73
74The copy of the Unicode Character Database included in Perl 5.9 has
75been updated to 4.0.1 from 4.0.0.
76
77=head2 suidperl less insecure
78
79Paul Szabo has analysed and patched C<suidperl> to remove existing known
80insecurities. Currently there are no known holes in C<suidperl>, but previous
81experience shows that we cannot be confident that these were the last. You may
82no longer invoke the set uid perl directly, so to preserve backwards
83compatibility with scripts that invoke #!/usr/bin/suidperl the only set uid
84binary is now C<sperl5.9.>I<n> (C<sperl5.9.2> for this release). C<suidperl>
85is installed as a hard link to C<perl>; both C<suidperl> and C<perl> will
86invoke C<sperl5.9.2> automatically the set uid binary, so this change should
87be completely transparent.
88
89For new projects the core perl team would strongly recommend that you use
90dedicated, single purpose security tools such as C<sudo> in preference to
91C<suidperl>.
92
93=head2 Formats
94
95In addition to bug fixes, C<format>'s features have been enhanced. See
96L<perlform>.
97
98=head2 Unicode Character Classes
99
100Perl's regular expression engine now contains support for matching on the
101intersection of two Unicode character classes. You can also now refer to
102user-defined character classes from within other user defined character
103classes.
1cdd6bcc 104
2bbb3949 105=head2 Byte-order modifiers for pack() and unpack()
106
107There are two new byte-order modifiers, C<E<gt>> (big-endian) and C<E<lt>>
108(little-endian), that can be appended to most pack() and unpack() template
109characters and groups to force a certain byte-order for that type or group.
110See L<perlfunc/pack> and L<perlpacktut> for details.
111
1af60bcb 112=head2 New variables
113
114A new variable, ${^RE_DEBUG_FLAGS}, controls what debug flags are in
115effect for the regular expression engine when running under C<use re
116"debug">. See L<re> for details.
117
118A new variable ${^UTF8LOCALE} indicates where an UTF-8 locale was detected
119by perl at startup.
120
e0eb806d 121=head1 Modules and Pragmata
122
3911fe8f 123=head2 New modules
124
125=over 4
126
127=item *
128
129C<Module::CoreList>, by Richard Clamp, is a small handy module that tells
130you what versions of core modules ship with any versions of Perl 5. It
131comes with a command-line frontend, C<corelist>.
132
133=back
134
135=head2 Updated And Improved Modules and Pragmata
136
1af60bcb 137Dual-lived modules have been updated to be kept up-to-date with respect to
138CPAN.
139
140The dual-lived modules which contain an C<_> in their version number are
141actually I<ahead> of the corresponding CPAN release.
142
143=over 4
144
145=item *
146
147=item B::Concise
148
149C<B::Concise> was significantly improved.
150
151=item Socket
152
153There is experimental support for Linux abstract Unix domain sockets.
154
155=item Sys::Syslog
156
157C<syslog()> can now use numeric constants for facility names and priorities,
158in addition to strings.
159
160=item threads
161
162Detached threads are now also supported on Windows.
163
164=back
165
e0eb806d 166=head1 Utility Changes
167
3911fe8f 168=over 4
169
170=item *
171
172The C<corelist> utility is now installed with perl (see L</"New Modules">
173above).
174
175=item *
176
177C<h2ph> and C<h2xs> have been made a bit more robust with regard to
178"modern" C code.
179
1af60bcb 180=item *
181
182Several bugs have been fixed in C<find2perl>, regarding C<-exec> and
183C<-eval>. Also the options C<-path>, C<-ipath> and C<-iname> have been
184added.
185
186=item *
187
188The Perl debugger can now save all debugger commands for sourcing later;
189notably, it can now emulate stepping backwards, by restarting and
190rerunning all bar the last command from a saved command history.
191
192It can also display the parent inheritance tree of a given class.
193
194Perl has a new -dt command-line flag, which enables threads support in the
195debugger.
196
3911fe8f 197=back
198
e0eb806d 199=head1 Documentation
200
201=head1 Performance Enhancements
202
1af60bcb 203=over 4
204
205=item *
206
207Unicode case mappings (C</i>, C<lc>, C<uc>, etc) are faster.
208
209=item *
210
211C<@a = sort @a> was optimized to do in-place sort. Likewise, C<reverse
212sort ...> is now optimized to sort in reverse, avoiding the generation of
213a temporary intermediate list.
214
215=item *
216
217Unnecessary assignment optimised away in
218
219 my $s = undef;
220 my @a = ();
221 my %h = ();
222
223=item *
224
225Optimised C<map> in scalar context
1cdd6bcc 226
1af60bcb 227=item *
228
229The regexp engine now implements the trie optimization : it's able to
230factorize common prefixes and suffixes in regular expressions. A new
231special variable, ${^RE_TRIE_MAXBUF}, has been added to fine tune this
232optimization.
233
234=back
1cdd6bcc 235
e0eb806d 236=head1 Installation and Configuration Improvements
237
1af60bcb 238There is alpha support for relocatable @INC entries.
239
240Perl should build on Interix and on GNU/kFreeBSD.
241
e0eb806d 242=head1 Selected Bug Fixes
243
1af60bcb 244Most of those bugs were reported in the perl 5.8.x maintainance track.
245Notably, quite a few utf8 bugs were fixed, and several memory leaks were
246suppressed.
247
248Development-only bug fixes include :
249
250C<$Foo::_> was wrongly forced as C<$main::_>.
251
e0eb806d 252=head1 New or Changed Diagnostics
253
1af60bcb 254A new warning, C<!=~ should be !~>, is emitted to prevent this misspelling
255of the non-matching operator.
256
3911fe8f 257The warning I<Newline in left-justified string> has been removed.
258
259The error I<Too late for "-T" option> has been reformulated to be more
260descriptive.
261
1af60bcb 262There is a new compilation error, I<Illegal declaration of subroutine>,
263for an obscure case of syntax errors.
264
265The diagnostic output of Carp has been changed slightly, to add a space after
266the comma between arguments. This makes it much easier for tools such as
267web browsers to wrap it, but might confuse any automatic tools which perform
268detailed parsing of Carp output.
269
270Perl -V has several improvements, making it more useable from shell
271scripts.
3911fe8f 272
e0eb806d 273=head1 Changed Internals
274
275=head1 Known Problems
276
277=head2 Platform Specific Problems
278
279=head1 Reporting Bugs
280
281If you find what you think is a bug, you might check the articles
282recently posted to the comp.lang.perl.misc newsgroup and the perl
283bug database at http://bugs.perl.org/ . There may also be
284information at http://www.perl.org/ , the Perl Home Page.
285
286If you believe you have an unreported bug, please run the B<perlbug>
287program included with your release. Be sure to trim your bug down
288to a tiny but sufficient test case. Your bug report, along with the
289output of C<perl -V>, will be sent off to perlbug@perl.org to be
290analysed by the Perl porting team.
291
292=head1 SEE ALSO
293
294The F<Changes> file for exhaustive details on what changed.
295
296The F<INSTALL> file for how to build Perl.
297
298The F<README> file for general stuff.
299
300The F<Artistic> and F<Copying> files for copyright information.
301
302=cut