summaryrefslogtreecommitdiff
path: root/pod/perl571delta.pod
blob: d58384a19ee956602c5304a53344245056880fd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
=head1 NAME

perl571delta - what's new for perl v5.7.1

=head1 DESCRIPTION

This document describes differences between the 5.7.0 release and the
5.7.1 release.  

(To view the differences between the 5.6.0 release and the 5.7.0
release, see L<perl570delta>).

=head1 Incompatible Changes

=over 4

=item *

Although "you shouldn't do that", it was possible to write code that
depends on Perl's hashed key order (Data::Dumper does this).  The new
algorithm "One-at-a-Time" produces a different hashed key order.
More details are in L<perldelta/Performance Enhancements>.

=back

=head1 Core Enhancements

=over 4

=item *

Anonymous temporary files are available without need to
'use FileHandle' or other module via

   open($fh,"+>", undef) || ...

=item *

IO is now by default done via PerlIO rather than system's "stdio".
PerlIO allows "layers" to be "pushed" onto a file handle to alter the
handle's behaviour.  Layers can be specified at open time via 3-arg
form of open:

   open($fh,'>:crlf :utf8', $path) || ...

or on already opened handles via extended C<binmode>:

   binmode($fh,':encoding(iso-8859-7)');

The built-in layers are: unix (low level read/write), stdio (as in
previous Perls), perlio (re-implementation of stdio buffering in a
portable manner), crlf (does CRLF <=> "\n" translation as on Win32,
but available on any platform).  A mmap layer may be available if
platform supports it (mostly UNIXes).

Layers to be applied by default may be specified via the 'open' pragma.

=item *

File handles can be marked as accepting Perl's internal encoding of Unicode
(UTF-8 or UTF-EBCDIC depending on platfrom) by a pseudo layer ":utf8" :

   open($fh,">:utf8","Uni.txt");

=item *

File handles can translate character encodings from/to Perl's internal
Unicode form on read/write via the ":encoding()" layer.

=item *

File handles can be opened to "in memory" files held in Perl scalars via:

   open($fh,'>', \$variable) || ...

=item *

Formats now support zero-padded decimal fields.

=item *

The list form of C<open> is now implemented for pipes (at least on UNIX):

   open($fh,"-|", 'cat', '/etc/motd')

creates a pipe, and runs the equivalent of exec('cat', '/etc/motd') in
the child process.

=item *
 
The printf and sprintf now support parameter reordering using the
C<%\d+\$> and C<*\d+\$> syntaxes.

=back

=head1 Performance Enhancements

=over 4

=item *

Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm
(http://burtleburtle.net/bob/hash/doobs.html).
This algorithm is reasonably fast while producing a much better spread
of values.  Hash values output from the algorithm on a hash of all
3-char printable ASCII keys comes much closer to passing the DIEHARD
random number generation tests.  According to perlbench, this change
has not affected the overall speed of Perl.

=back

=head1 Installation and Configuration Improvements

=over 4

=item *

Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm)
when building the Perl binary. The only exception to this is SunOS 4.x,
which needs them.

=back

=head1 Selected Bug Fixes

=over 4

=item *

vec() now tries to work with characters <= 255 when possible, but it leaves
higher character values in place.  In that case, if vec() was used to modify
the string, it is no longer considered to be utf8-encoded.

=back

=head1 Core Enhancements

=head2 New Modules

=over 4

=item *

Encode provides a mechanism to translate between different character
encodings.  Support for Unicode, ISO-8859-*, ASCII, CP*, KOI8-R, and
three variants of EBCDIC are compiled in to the module.  Several other
encodings (like Japanese, Chinese, and MacIntosh encodings) are
included and will be loaded at runtime.

=item *

Any encoding supported by Encode module is also available to the
":encoding()" layer if PerlIO is used.

=item *

PerlIO::Scalar provides the IO to "in memory" perl scalars discussed
above.  It also serves as an example of a loadable layer.

=item *

PerlIO::Via acts as a PerlIO layer and wraps PerlIO layer
functionality provided by a class (typically implemented in
perl code).

=item *

MIME::QuotedPrint has been enhanced to provide the basic methods
necessary to use it with PerlIO::Via as in :

 use MIME::QuotedPrint;
 open($fh,">Via(MIME::QuotedPrint)",$path)

=back

=head2 Updated And Improved Modules and Pragmata

=over 4

=item *

The C<open> pragma allows layers other than ":raw" and ":crlf" when
using PerlIO.

=item *

The utf8:: name space (as in the pragma) provides various
Perl-callable functions to provide low level access to Perl's
internal Unicode representation.

=back

=head1 Known Problems

=head2 sprintf tests 129 and 130

The op/sprintf tests 129 and 130 are known to fail in some platforms.
Examples include any platform using sfio, and Tandem's NonStop-UX.
The failing platforms do not comply with the ANSI C Standard, line
19ff on page 134 of ANSI X3.159 1989 to be exact.  (They produce
something else than "1" and "-1" when formatting 0.6 and -0.6 using
the printf format "%.0f", most often they produce "0" and "-0".)

=head1 Reporting Bugs

If you find what you think is a bug, you might check the articles
recently posted to the comp.lang.perl.misc newsgroup and the perl
bug database at http://bugs.perl.org.  There may also be
information at http://www.perl.com/perl/, the Perl Home Page.

If you believe you have an unreported bug, please run the B<perlbug>
program included with your release.  Be sure to trim your bug down
to a tiny but sufficient test case.  Your bug report, along with the
output of C<perl -V>, will be sent off to perlbug@perl.org to be
analysed by the Perl porting team.

=head1 SEE ALSO

The F<Changes> file for exhaustive details on what changed.

The F<INSTALL> file for how to build Perl.

The F<README> file for general stuff.

The F<Artistic> and F<Copying> files for copyright information.

=head1 HISTORY

Written by Jarkko Hietaniemi <F<jhi@iki.fi>>, with many contributions
from The Perl Porters and Perl Users submitting feedback and patches.

Send omissions or corrections to <F<perlbug@perl.org>>.

=cut