summaryrefslogtreecommitdiff
path: root/pod/perl591delta.pod
blob: bf26c2bc751d74dca0fdc199a338ae460ce5ce4f (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
=head1 NAME

perldelta - what is new for perl v5.9.1

=head1 DESCRIPTION

This document describes differences between the 5.9.0 release and
the 5.9.1 release.

=head1 Incompatible Changes

=head1 Core Enhancements

=head2 Lexical C<$_>

The default variable C<$_> can now be lexicalized, by declaring it like
any other lexical variable, with a simple

    my $_;

The operations that default on C<$_> will use the lexically-scoped
version of C<$_> when it exists, instead of the global C<$_>.

In a C<map> or a C<grep> block, if C<$_> was previously my'ed, then the
C<$_> inside the block is lexical as well (and scoped to the block).

In a scope where C<$_> has been lexicalized, you can still have access to
the global version of C<$_> by using C<$::_>, or, more simply, by
overriding the lexical declaration with C<our $_>.

=head2 Tied hashes in scalar context

As of perl 5.8.2, tied hashes did not return anything useful in scalar
context, for example when used as boolean tests:

	if (%tied_hash) { ... }

The old nonsensical behaviour was always to return false,
regardless of whether the hash is empty or has elements.

There is now an interface for the implementors of tied hashes to implement
the behaviour of a hash in scalar context, via the SCALAR method (see
L<perltie>).  Without a SCALAR method, perl will try to guess whether
the hash is empty, by testing if it's inside an iteration (in this case
it can't be empty) or by calling FIRSTKEY.

=head2 Formats

Formats were improved in several ways. A new field, C<^*>, can be used for
variable-width, one-line-at-a-time text. Null characters are now handled
correctly in picture lines. Using C<@#> and C<~~> together will now
produce a compile-time error, as those format fields are incompatible.
L<perlform> has been improved, and miscellaneous bugs fixed.

=head2 The C<:unique> attribute is only meaningful for globals

Now applying C<:unique> to lexical variables and to subroutines will
result in a compilation error.

=head1 Modules and Pragmata

=over 4

=item Carp

The error messages produced by C<Carp> now include spaces between the
arguments in function argument lists: this makes long error messages
appear more nicely in browsers and other tools.

=item Exporter

C<Exporter> will now recognize grouping tags (such as C<:name>) anywhere
in the import list, not only at the beginning.

=item FindBin

A function C<again> is provided to resolve problems where modules in different
directories wish to use FindBin.

=item List::Util

You can now weaken references to read only values.

=item threads::shared

C<cond_wait> has a new two argument form. C<cond_timedwait> has been added.

=back

=head1 Utility Changes

C<find2perl> now assumes C<-print> as a default action. Previously, it
needed to be specified explicitly.

A new utility, C<prove>, makes it easy to run an individual regression test
at the command line. C<prove> is part of Test::Harness, which users of earlier
Perl versions can install from CPAN.

=head1 Documentation

The documentation has been revised in places to produce more standard manpages.

The long-existing feature of C</(?{...})/> regexps setting C<$_> and pos()
is now documented.

=head1 Performance Enhancements

=head1 Installation and Configuration Improvements

=head1 Selected Bug Fixes

=head2 UTF8 bugs

Using substr() on a UTF8 string could cause subsequent accesses on that
string to return garbage. This was due to incorrect UTF8 offsets being
cached, and is now fixed.

join() could return garbage when the same join() statement was used to
process 8 bit data having earlier processed UTF8 data, due to the flags
on that statement's temporary workspace not being reset correctly. This
is now fixed.

Using Unicode keys with tied hashes should now work correctly.

chop() and chomp() used to mangle UTF8 strings.  This has been fixed.

=head2 Threading bugs

Hashes with the C<:unique> attribute weren't made read-only in new
threads. They are now.

=head2 More bugs

C<$a .. $b> will now work as expected when either $a or $b is C<undef>

Reading $^E now preserves $!. Previously, the C code implementing $^E
did not preserve C<errno>, so reading $^E could cause C<errno> and therefore
C<$!> to change unexpectedly.

Reentrant functions will (once more) work with C++. 5.8.2 introduced a bugfix
which accidentally broke the compilation of Perl extensions written in C++

=head1 New or Changed Diagnostics

The fatal error "DESTROY created new reference to dead object" is now
documented in L<perldiag>.

A new error, "%ENV is aliased to %s", is produced when taint checks are
enabled and when *ENV has been aliased (and thus doesn't reflect the
program's environment anymore.)

=head1 Changed Internals

=head1 Configuration and Building

C<Configure> now invokes callbacks regardless of the value of the variable
they are called for. Previously callbacks were only invoked in the
C<case $variable $define)> branch. This change should only affect platform
maintainers writing configuration hints files.

=head1 New Tests

=head1 Known Problems

=head1 Platform Specific Problems

=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/ , 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.

=cut