d58384a19ee956602c5304a53344245056880fd8
[p5sagit/p5-mst-13.2.git] / pod / perl571delta.pod
1 =head1 NAME
2
3 perl571delta - what's new for perl v5.7.1
4
5 =head1 DESCRIPTION
6
7 This document describes differences between the 5.7.0 release and the
8 5.7.1 release.  
9
10 (To view the differences between the 5.6.0 release and the 5.7.0
11 release, see L<perl570delta>).
12
13 =head1 Incompatible Changes
14
15 =over 4
16
17 =item *
18
19 Although "you shouldn't do that", it was possible to write code that
20 depends on Perl's hashed key order (Data::Dumper does this).  The new
21 algorithm "One-at-a-Time" produces a different hashed key order.
22 More details are in L<perldelta/Performance Enhancements>.
23
24 =back
25
26 =head1 Core Enhancements
27
28 =over 4
29
30 =item *
31
32 Anonymous temporary files are available without need to
33 'use FileHandle' or other module via
34
35    open($fh,"+>", undef) || ...
36
37 =item *
38
39 IO is now by default done via PerlIO rather than system's "stdio".
40 PerlIO allows "layers" to be "pushed" onto a file handle to alter the
41 handle's behaviour.  Layers can be specified at open time via 3-arg
42 form of open:
43
44    open($fh,'>:crlf :utf8', $path) || ...
45
46 or on already opened handles via extended C<binmode>:
47
48    binmode($fh,':encoding(iso-8859-7)');
49
50 The built-in layers are: unix (low level read/write), stdio (as in
51 previous Perls), perlio (re-implementation of stdio buffering in a
52 portable manner), crlf (does CRLF <=> "\n" translation as on Win32,
53 but available on any platform).  A mmap layer may be available if
54 platform supports it (mostly UNIXes).
55
56 Layers to be applied by default may be specified via the 'open' pragma.
57
58 =item *
59
60 File handles can be marked as accepting Perl's internal encoding of Unicode
61 (UTF-8 or UTF-EBCDIC depending on platfrom) by a pseudo layer ":utf8" :
62
63    open($fh,">:utf8","Uni.txt");
64
65 =item *
66
67 File handles can translate character encodings from/to Perl's internal
68 Unicode form on read/write via the ":encoding()" layer.
69
70 =item *
71
72 File handles can be opened to "in memory" files held in Perl scalars via:
73
74    open($fh,'>', \$variable) || ...
75
76 =item *
77
78 Formats now support zero-padded decimal fields.
79
80 =item *
81
82 The list form of C<open> is now implemented for pipes (at least on UNIX):
83
84    open($fh,"-|", 'cat', '/etc/motd')
85
86 creates a pipe, and runs the equivalent of exec('cat', '/etc/motd') in
87 the child process.
88
89 =item *
90  
91 The printf and sprintf now support parameter reordering using the
92 C<%\d+\$> and C<*\d+\$> syntaxes.
93
94 =back
95
96 =head1 Performance Enhancements
97
98 =over 4
99
100 =item *
101
102 Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm
103 (http://burtleburtle.net/bob/hash/doobs.html).
104 This algorithm is reasonably fast while producing a much better spread
105 of values.  Hash values output from the algorithm on a hash of all
106 3-char printable ASCII keys comes much closer to passing the DIEHARD
107 random number generation tests.  According to perlbench, this change
108 has not affected the overall speed of Perl.
109
110 =back
111
112 =head1 Installation and Configuration Improvements
113
114 =over 4
115
116 =item *
117
118 Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm)
119 when building the Perl binary. The only exception to this is SunOS 4.x,
120 which needs them.
121
122 =back
123
124 =head1 Selected Bug Fixes
125
126 =over 4
127
128 =item *
129
130 vec() now tries to work with characters <= 255 when possible, but it leaves
131 higher character values in place.  In that case, if vec() was used to modify
132 the string, it is no longer considered to be utf8-encoded.
133
134 =back
135
136 =head1 Core Enhancements
137
138 =head2 New Modules
139
140 =over 4
141
142 =item *
143
144 Encode provides a mechanism to translate between different character
145 encodings.  Support for Unicode, ISO-8859-*, ASCII, CP*, KOI8-R, and
146 three variants of EBCDIC are compiled in to the module.  Several other
147 encodings (like Japanese, Chinese, and MacIntosh encodings) are
148 included and will be loaded at runtime.
149
150 =item *
151
152 Any encoding supported by Encode module is also available to the
153 ":encoding()" layer if PerlIO is used.
154
155 =item *
156
157 PerlIO::Scalar provides the IO to "in memory" perl scalars discussed
158 above.  It also serves as an example of a loadable layer.
159
160 =item *
161
162 PerlIO::Via acts as a PerlIO layer and wraps PerlIO layer
163 functionality provided by a class (typically implemented in
164 perl code).
165
166 =item *
167
168 MIME::QuotedPrint has been enhanced to provide the basic methods
169 necessary to use it with PerlIO::Via as in :
170
171  use MIME::QuotedPrint;
172  open($fh,">Via(MIME::QuotedPrint)",$path)
173
174 =back
175
176 =head2 Updated And Improved Modules and Pragmata
177
178 =over 4
179
180 =item *
181
182 The C<open> pragma allows layers other than ":raw" and ":crlf" when
183 using PerlIO.
184
185 =item *
186
187 The utf8:: name space (as in the pragma) provides various
188 Perl-callable functions to provide low level access to Perl's
189 internal Unicode representation.
190
191 =back
192
193 =head1 Known Problems
194
195 =head2 sprintf tests 129 and 130
196
197 The op/sprintf tests 129 and 130 are known to fail in some platforms.
198 Examples include any platform using sfio, and Tandem's NonStop-UX.
199 The failing platforms do not comply with the ANSI C Standard, line
200 19ff on page 134 of ANSI X3.159 1989 to be exact.  (They produce
201 something else than "1" and "-1" when formatting 0.6 and -0.6 using
202 the printf format "%.0f", most often they produce "0" and "-0".)
203
204 =head1 Reporting Bugs
205
206 If you find what you think is a bug, you might check the articles
207 recently posted to the comp.lang.perl.misc newsgroup and the perl
208 bug database at http://bugs.perl.org.  There may also be
209 information at http://www.perl.com/perl/, the Perl Home Page.
210
211 If you believe you have an unreported bug, please run the B<perlbug>
212 program included with your release.  Be sure to trim your bug down
213 to a tiny but sufficient test case.  Your bug report, along with the
214 output of C<perl -V>, will be sent off to perlbug@perl.org to be
215 analysed by the Perl porting team.
216
217 =head1 SEE ALSO
218
219 The F<Changes> file for exhaustive details on what changed.
220
221 The F<INSTALL> file for how to build Perl.
222
223 The F<README> file for general stuff.
224
225 The F<Artistic> and F<Copying> files for copyright information.
226
227 =head1 HISTORY
228
229 Written by Jarkko Hietaniemi <F<jhi@iki.fi>>, with many contributions
230 from The Perl Porters and Perl Users submitting feedback and patches.
231
232 Send omissions or corrections to <F<perlbug@perl.org>>.
233
234 =cut