Commit | Line | Data |
b6235c4f |
1 | =head1 NAME |
2 | |
38fd2c23 |
3 | perl581delta - what is new for perl v5.8.1 |
b6235c4f |
4 | |
5 | =head1 DESCRIPTION |
6 | |
7 | This document describes differences between the 5.8.0 release and |
8 | the 5.8.1 release. |
9 | |
10 | If you are upgrading from an earlier release such as 5.6.1, first read |
11 | the L<perl58delta>, which describes differences between 5.6.0 and |
12 | 5.8.0. |
13 | |
14 | In case you are wondering about 5.6.1, it was bug-fix-wise rather |
15 | identical to the development release 5.7.1. Confused? This timeline |
16 | hopefully helps a bit: it lists the new major releases, their maintenance |
17 | releases, and the development releases. |
18 | |
19 | New Maintenance Development |
20 | |
21 | 5.6.0 2000-Mar-22 |
22 | 5.7.0 2000-Sep-02 |
23 | 5.6.1 2001-Apr-08 |
24 | 5.7.1 2001-Apr-09 |
25 | 5.7.2 2001-Jul-13 |
26 | 5.7.3 2002-Mar-05 |
27 | 5.8.0 2002-Jul-18 |
28 | 5.8.1 2003-Sep-25 |
29 | |
30 | =head1 Incompatible Changes |
31 | |
32 | =head2 Hash Randomisation |
33 | |
34 | Mainly due to security reasons, the "random ordering" of hashes |
35 | has been made even more random. Previously while the order of hash |
36 | elements from keys(), values(), and each() was essentially random, |
37 | it was still repeatable. Now, however, the order varies between |
38 | different runs of Perl. |
39 | |
40 | B<Perl has never guaranteed any ordering of the hash keys>, and the |
41 | ordering has already changed several times during the lifetime of |
42 | Perl 5. Also, the ordering of hash keys has always been, and |
43 | continues to be, affected by the insertion order. |
44 | |
45 | The added randomness may affect applications. |
46 | |
47 | One possible scenario is when output of an application has included |
48 | hash data. For example, if you have used the Data::Dumper module to |
49 | dump data into different files, and then compared the files to see |
50 | whether the data has changed, now you will have false positives since |
51 | the order in which hashes are dumped will vary. In general the cure |
52 | is to sort the keys (or the values); in particular for Data::Dumper to |
53 | use the C<Sortkeys> option. If some particular order is really |
54 | important, use tied hashes: for example the Tie::IxHash module |
55 | which by default preserves the order in which the hash elements |
56 | were added. |
57 | |
58 | More subtle problem is reliance on the order of "global destruction". |
59 | That is what happens at the end of execution: Perl destroys all data |
60 | structures, including user data. If your destructors (the DESTROY |
61 | subroutines) have assumed any particular ordering to the global |
62 | destruction, there might be problems ahead. For example, in a |
63 | destructor of one object you cannot assume that objects of any other |
64 | class are still available, unless you hold a reference to them. |
65 | If the environment variable PERL_DESTRUCT_LEVEL is set to a non-zero |
66 | value, or if Perl is exiting a spawned thread, it will also destruct |
67 | the ordinary references and the symbol tables that are no longer in use. |
68 | You can't call a class method or an ordinary function on a class that |
69 | has been collected that way. |
70 | |
71 | The hash randomisation is certain to reveal hidden assumptions about |
72 | some particular ordering of hash elements, and outright bugs: it |
73 | revealed a few bugs in the Perl core and core modules. |
74 | |
75 | To disable the hash randomisation in runtime, set the environment |
76 | variable PERL_HASH_SEED to 0 (zero) before running Perl (for more |
77 | information see L<perlrun/PERL_HASH_SEED>), or to disable the feature |
78 | completely in compile time, compile with C<-DNO_HASH_SEED> (see F<INSTALL>). |
79 | |
80 | See L<perlsec/"Algorithmic Complexity Attacks"> for the original |
81 | rationale behind this change. |
82 | |
83 | =head2 UTF-8 On Filehandles No Longer Activated By Locale |
84 | |
85 | In Perl 5.8.0 all filehandles, including the standard filehandles, |
86 | were implicitly set to be in Unicode UTF-8 if the locale settings |
87 | indicated the use of UTF-8. This feature caused too many problems, |
88 | so the feature was turned off and redesigned: see L</"Core Enhancements">. |
89 | |
90 | =head2 Single-number v-strings are no longer v-strings before "=>" |
91 | |
92 | The version strings or v-strings (see L<perldata/"Version Strings">) |
93 | feature introduced in Perl 5.6.0 has been a source of some confusion-- |
94 | especially when the user did not want to use it, but Perl thought it |
95 | knew better. Especially troublesome has been the feature that before |
96 | a "=>" a version string (a "v" followed by digits) has been interpreted |
97 | as a v-string instead of a string literal. In other words: |
98 | |
99 | %h = ( v65 => 42 ); |
100 | |
101 | has meant since Perl 5.6.0 |
102 | |
103 | %h = ( 'A' => 42 ); |
104 | |
105 | (at least in platforms of ASCII progeny) Perl 5.8.1 restores the |
106 | more natural interpretation |
107 | |
108 | %h = ( 'v65' => 42 ); |
109 | |
110 | The multi-number v-strings like v65.66 and 65.66.67 still continue to |
111 | be v-strings in Perl 5.8. |
112 | |
113 | =head2 (Win32) The -C Switch Has Been Repurposed |
114 | |
115 | The -C switch has changed in an incompatible way. The old semantics |
116 | of this switch only made sense in Win32 and only in the "use utf8" |
117 | universe in 5.6.x releases, and do not make sense for the Unicode |
118 | implementation in 5.8.0. Since this switch could not have been used |
119 | by anyone, it has been repurposed. The behavior that this switch |
120 | enabled in 5.6.x releases may be supported in a transparent, |
121 | data-dependent fashion in a future release. |
122 | |
123 | For the new life of this switch, see L<"UTF-8 no longer default under |
124 | UTF-8 locales">, and L<perlrun/-C>. |
125 | |
126 | =head2 (Win32) The /d Switch Of cmd.exe |
127 | |
128 | Perl 5.8.1 uses the /d switch when running the cmd.exe shell |
129 | internally for system(), backticks, and when opening pipes to external |
130 | programs. The extra switch disables the execution of AutoRun commands |
131 | from the registry, which is generally considered undesirable when |
132 | running external programs. If you wish to retain compatibility with |
133 | the older behavior, set PERL5SHELL in your environment to C<cmd /x/c>. |
134 | |
135 | =head1 Core Enhancements |
136 | |
137 | =head2 UTF-8 no longer default under UTF-8 locales |
138 | |
139 | In Perl 5.8.0 many Unicode features were introduced. One of them |
140 | was found to be of more nuisance than benefit: the automagic |
141 | (and silent) "UTF-8-ification" of filehandles, including the |
142 | standard filehandles, if the user's locale settings indicated |
143 | use of UTF-8. |
144 | |
145 | For example, if you had C<en_US.UTF-8> as your locale, your STDIN and |
146 | STDOUT were automatically "UTF-8", in other words an implicit |
147 | binmode(..., ":utf8") was made. This meant that trying to print, say, |
148 | chr(0xff), ended up printing the bytes 0xc3 0xbf. Hardly what |
149 | you had in mind unless you were aware of this feature of Perl 5.8.0. |
150 | The problem is that the vast majority of people weren't: for example |
151 | in RedHat releases 8 and 9 the B<default> locale setting is UTF-8, so |
152 | all RedHat users got UTF-8 filehandles, whether they wanted it or not. |
153 | The pain was intensified by the Unicode implementation of Perl 5.8.0 |
154 | (still) having nasty bugs, especially related to the use of s/// and |
155 | tr///. (Bugs that have been fixed in 5.8.1) |
156 | |
157 | Therefore a decision was made to backtrack the feature and change it |
158 | from implicit silent default to explicit conscious option. The new |
159 | Perl command line option C<-C> and its counterpart environment |
160 | variable PERL_UNICODE can now be used to control how Perl and Unicode |
161 | interact at interfaces like I/O and for example the command line |
162 | arguments. See L<perlrun/-C> and L<perlrun/PERL_UNICODE> for more |
163 | information. |
164 | |
165 | =head2 Unsafe signals again available |
166 | |
167 | In Perl 5.8.0 the so-called "safe signals" were introduced. This |
168 | means that Perl no longer handles signals immediately but instead |
169 | "between opcodes", when it is safe to do so. The earlier immediate |
170 | handling easily could corrupt the internal state of Perl, resulting |
171 | in mysterious crashes. |
172 | |
173 | However, the new safer model has its problems too. Because now an |
174 | opcode, a basic unit of Perl execution, is never interrupted but |
175 | instead let to run to completion, certain operations that can take a |
176 | long time now really do take a long time. For example, certain |
177 | network operations have their own blocking and timeout mechanisms, and |
178 | being able to interrupt them immediately would be nice. |
179 | |
180 | Therefore perl 5.8.1 introduces a "backdoor" to restore the pre-5.8.0 |
181 | (pre-5.7.3, really) signal behaviour. Just set the environment variable |
182 | PERL_SIGNALS to C<unsafe>, and the old immediate (and unsafe) |
183 | signal handling behaviour returns. See L<perlrun/PERL_SIGNALS> |
184 | and L<perlipc/"Deferred Signals (Safe Signals)">. |
185 | |
186 | In completely unrelated news, you can now use safe signals with |
187 | POSIX::SigAction. See L<POSIX/POSIX::SigAction>. |
188 | |
189 | =head2 Tied Arrays with Negative Array Indices |
190 | |
191 | Formerly, the indices passed to C<FETCH>, C<STORE>, C<EXISTS>, and |
192 | C<DELETE> methods in tied array class were always non-negative. If |
193 | the actual argument was negative, Perl would call FETCHSIZE implicitly |
194 | and add the result to the index before passing the result to the tied |
195 | array method. This behaviour is now optional. If the tied array class |
196 | contains a package variable named C<$NEGATIVE_INDICES> which is set to |
197 | a true value, negative values will be passed to C<FETCH>, C<STORE>, |
198 | C<EXISTS>, and C<DELETE> unchanged. |
199 | |
200 | =head2 local ${$x} |
201 | |
202 | The syntaxes |
203 | |
204 | local ${$x} |
205 | local @{$x} |
206 | local %{$x} |
207 | |
208 | now do localise variables, given that the $x is a valid variable name. |
209 | |
210 | =head2 Unicode Character Database 4.0.0 |
211 | |
212 | The copy of the Unicode Character Database included in Perl 5.8 has |
213 | been updated to 4.0.0 from 3.2.0. This means for example that the |
214 | Unicode character properties are as in Unicode 4.0.0. |
215 | |
216 | =head2 Deprecation Warnings |
217 | |
218 | There is one new feature deprecation. Perl 5.8.0 forgot to add |
219 | some deprecation warnings, these warnings have now been added. |
220 | Finally, a reminder of an impending feature removal. |
221 | |
222 | =head3 (Reminder) Pseudo-hashes are deprecated (really) |
223 | |
224 | Pseudo-hashes were deprecated in Perl 5.8.0 and will be removed in |
225 | Perl 5.10.0, see L<perl58delta> for details. Each attempt to access |
226 | pseudo-hashes will trigger the warning C<Pseudo-hashes are deprecated>. |
227 | If you really want to continue using pseudo-hashes but not to see the |
228 | deprecation warnings, use: |
229 | |
230 | no warnings 'deprecated'; |
231 | |
232 | Or you can continue to use the L<fields> pragma, but please don't |
233 | expect the data structures to be pseudohashes any more. |
234 | |
235 | =head3 (Reminder) 5.005-style threads are deprecated (really) |
236 | |
237 | 5.005-style threads (activated by C<use Thread;>) were deprecated in |
238 | Perl 5.8.0 and will be removed after Perl 5.8, see L<perl58delta> for |
239 | details. Each 5.005-style thread creation will trigger the warning |
240 | C<5.005 threads are deprecated>. If you really want to continue |
241 | using the 5.005 threads but not to see the deprecation warnings, use: |
242 | |
243 | no warnings 'deprecated'; |
244 | |
245 | =head3 (Reminder) The $* variable is deprecated (really) |
246 | |
247 | The C<$*> variable controlling multi-line matching has been deprecated |
248 | and will be removed after 5.8. The variable has been deprecated for a |
249 | long time, and a deprecation warning C<Use of $* is deprecated> is given, |
250 | now the variable will just finally be removed. The functionality has |
251 | been supplanted by the C</s> and C</m> modifiers on pattern matching. |
252 | If you really want to continue using the C<$*>-variable but not to see |
253 | the deprecation warnings, use: |
254 | |
255 | no warnings 'deprecated'; |
256 | |
257 | =head2 Miscellaneous Enhancements |
258 | |
259 | C<map> in void context is no longer expensive. C<map> is now context |
260 | aware, and will not construct a list if called in void context. |
261 | |
262 | If a socket gets closed by the server while printing to it, the client |
263 | now gets a SIGPIPE. While this new feature was not planned, it fell |
264 | naturally out of PerlIO changes, and is to be considered an accidental |
265 | feature. |
266 | |
267 | PerlIO::get_layers(FH) returns the names of the PerlIO layers |
268 | active on a filehandle. |
269 | |
270 | PerlIO::via layers can now have an optional UTF8 method to |
271 | indicate whether the layer wants to "auto-:utf8" the stream. |
272 | |
273 | utf8::is_utf8() has been added as a quick way to test whether |
274 | a scalar is encoded internally in UTF-8 (Unicode). |
275 | |
276 | =head1 Modules and Pragmata |
277 | |
278 | =head2 Updated Modules And Pragmata |
279 | |
280 | The following modules and pragmata have been updated since Perl 5.8.0: |
281 | |
282 | =over 4 |
283 | |
284 | =item base |
285 | |
286 | =item B::Bytecode |
287 | |
288 | In much better shape than it used to be. Still far from perfect, but |
289 | maybe worth a try. |
290 | |
291 | =item B::Concise |
292 | |
293 | =item B::Deparse |
294 | |
295 | =item Benchmark |
296 | |
297 | An optional feature, C<:hireswallclock>, now allows for high |
298 | resolution wall clock times (uses Time::HiRes). |
299 | |
300 | =item ByteLoader |
301 | |
302 | See B::Bytecode. |
303 | |
304 | =item bytes |
305 | |
306 | Now has bytes::substr. |
307 | |
308 | =item CGI |
309 | |
310 | =item charnames |
311 | |
312 | One can now have custom character name aliases. |
313 | |
314 | =item CPAN |
315 | |
316 | There is now a simple command line frontend to the CPAN.pm |
317 | module called F<cpan>. |
318 | |
319 | =item Data::Dumper |
320 | |
321 | A new option, Pair, allows choosing the separator between hash keys |
322 | and values. |
323 | |
324 | =item DB_File |
325 | |
326 | =item Devel::PPPort |
327 | |
328 | =item Digest::MD5 |
329 | |
330 | =item Encode |
331 | |
332 | Significant updates on the encoding pragma functionality |
333 | (tr/// and the DATA filehandle, formats). |
334 | |
335 | If a filehandle has been marked as to have an encoding, unmappable |
336 | characters are detected already during input, not later (when the |
337 | corrupted data is being used). |
338 | |
339 | The ISO 8859-6 conversion table has been corrected (the 0x30..0x39 |
340 | erroneously mapped to U+0660..U+0669, instead of U+0030..U+0039). The |
341 | GSM 03.38 conversion did not handle escape sequences correctly. The |
342 | UTF-7 encoding has been added (making Encode feature-complete with |
343 | Unicode::String). |
344 | |
345 | =item fields |
346 | |
347 | =item libnet |
348 | |
349 | =item Math::BigInt |
350 | |
351 | A lot of bugs have been fixed since v1.60, the version included in Perl |
352 | v5.8.0. Especially noteworthy are the bug in Calc that caused div and mod to |
353 | fail for some large values, and the fixes to the handling of bad inputs. |
354 | |
355 | Some new features were added, e.g. the broot() method, you can now pass |
356 | parameters to config() to change some settings at runtime, and it is now |
357 | possible to trap the creation of NaN and infinity. |
358 | |
359 | As usual, some optimizations took place and made the math overall a tad |
360 | faster. In some cases, quite a lot faster, actually. Especially alternative |
361 | libraries like Math::BigInt::GMP benefit from this. In addition, a lot of the |
362 | quite clunky routines like fsqrt() and flog() are now much much faster. |
363 | |
364 | =item MIME::Base64 |
365 | |
366 | =item NEXT |
367 | |
368 | Diamond inheritance now works. |
369 | |
370 | =item Net::Ping |
371 | |
372 | =item PerlIO::scalar |
373 | |
374 | Reading from non-string scalars (like the special variables, see |
375 | L<perlvar>) now works. |
376 | |
377 | =item podlators |
378 | |
379 | =item Pod::LaTeX |
380 | |
381 | =item PodParsers |
382 | |
383 | =item Pod::Perldoc |
384 | |
385 | Complete rewrite. As a side-effect, no longer refuses to startup when |
386 | run by root. |
387 | |
388 | =item Scalar::Util |
389 | |
390 | New utilities: refaddr, isvstring, looks_like_number, set_prototype. |
391 | |
392 | =item Storable |
393 | |
394 | Can now store code references (via B::Deparse, so not foolproof). |
395 | |
396 | =item strict |
397 | |
398 | Earlier versions of the strict pragma did not check the parameters |
399 | implicitly passed to its "import" (use) and "unimport" (no) routine. |
400 | This caused the false idiom such as: |
401 | |
402 | use strict qw(@ISA); |
403 | @ISA = qw(Foo); |
404 | |
405 | This however (probably) raised the false expectation that the strict |
406 | refs, vars and subs were being enforced (and that @ISA was somehow |
407 | "declared"). But the strict refs, vars, and subs are B<not> enforced |
408 | when using this false idiom. |
409 | |
410 | Starting from Perl 5.8.1, the above B<will> cause an error to be |
411 | raised. This may cause programs which used to execute seemingly |
412 | correctly without warnings and errors to fail when run under 5.8.1. |
413 | This happens because |
414 | |
415 | use strict qw(@ISA); |
416 | |
417 | will now fail with the error: |
418 | |
419 | Unknown 'strict' tag(s) '@ISA' |
420 | |
421 | The remedy to this problem is to replace this code with the correct idiom: |
422 | |
423 | use strict; |
424 | use vars qw(@ISA); |
425 | @ISA = qw(Foo); |
426 | |
427 | =item Term::ANSIcolor |
428 | |
429 | =item Test::Harness |
430 | |
431 | Now much more picky about extra or missing output from test scripts. |
432 | |
433 | =item Test::More |
434 | |
435 | =item Test::Simple |
436 | |
437 | =item Text::Balanced |
438 | |
439 | =item Time::HiRes |
440 | |
441 | Use of nanosleep(), if available, allows mixing subsecond sleeps with |
442 | alarms. |
443 | |
444 | =item threads |
445 | |
446 | Several fixes, for example for join() problems and memory |
447 | leaks. In some platforms (like Linux) that use glibc the minimum memory |
448 | footprint of one ithread has been reduced by several hundred kilobytes. |
449 | |
450 | =item threads::shared |
451 | |
452 | Many memory leaks have been fixed. |
453 | |
454 | =item Unicode::Collate |
455 | |
456 | =item Unicode::Normalize |
457 | |
458 | =item Win32::GetFolderPath |
459 | |
460 | =item Win32::GetOSVersion |
461 | |
462 | Now returns extra information. |
463 | |
464 | =back |
465 | |
466 | =head1 Utility Changes |
467 | |
468 | The C<h2xs> utility now produces a more modern layout: |
469 | F<Foo-Bar/lib/Foo/Bar.pm> instead of F<Foo/Bar/Bar.pm>. |
470 | Also, the boilerplate test is now called F<t/Foo-Bar.t> |
471 | instead of F<t/1.t>. |
472 | |
473 | The Perl debugger (F<lib/perl5db.pl>) has now been extensively |
474 | documented and bugs found while documenting have been fixed. |
475 | |
476 | C<perldoc> has been rewritten from scratch to be more robust and |
477 | featureful. |
478 | |
479 | C<perlcc -B> works now at least somewhat better, while C<perlcc -c> |
480 | is rather more broken. (The Perl compiler suite as a whole continues |
481 | to be experimental.) |
482 | |
483 | =head1 New Documentation |
484 | |
485 | perl573delta has been added to list the differences between the |
486 | (now quite obsolete) development releases 5.7.2 and 5.7.3. |
487 | |
488 | perl58delta has been added: it is the perldelta of 5.8.0, detailing |
489 | the differences between 5.6.0 and 5.8.0. |
490 | |
491 | perlartistic has been added: it is the Artistic License in pod format, |
492 | making it easier for modules to refer to it. |
493 | |
494 | perlcheat has been added: it is a Perl cheat sheet. |
495 | |
496 | perlgpl has been added: it is the GNU General Public License in pod |
497 | format, making it easier for modules to refer to it. |
498 | |
499 | perlmacosx has been added to tell about the installation and use |
500 | of Perl in Mac OS X. |
501 | |
502 | perlos400 has been added to tell about the installation and use |
503 | of Perl in OS/400 PASE. |
504 | |
505 | perlreref has been added: it is a regular expressions quick reference. |
506 | |
507 | =head1 Installation and Configuration Improvements |
508 | |
509 | The UNIX standard Perl location, F</usr/bin/perl>, is no longer |
510 | overwritten by default if it exists. This change was very prudent |
511 | because so many UNIX vendors already provide a F</usr/bin/perl>, |
512 | but simultaneously many system utilities may depend on that |
513 | exact version of Perl, so better not to overwrite it. |
514 | |
515 | One can now specify installation directories for site and vendor man |
516 | and HTML pages, and site and vendor scripts. See F<INSTALL>. |
517 | |
518 | One can now specify a destination directory for Perl installation |
519 | by specifying the DESTDIR variable for C<make install>. (This feature |
520 | is slightly different from the previous C<Configure -Dinstallprefix=...>.) |
521 | See F<INSTALL>. |
522 | |
523 | gcc versions 3.x introduced a new warning that caused a lot of noise |
524 | during Perl compilation: C<gcc -Ialreadyknowndirectory (warning: |
525 | changing search order)>. This warning has now been avoided by |
526 | Configure weeding out such directories before the compilation. |
527 | |
528 | One can now build subsets of Perl core modules by using the |
529 | Configure flags C<-Dnoextensions=...> and C<-Donlyextensions=...>, |
530 | see F<INSTALL>. |
531 | |
532 | =head2 Platform-specific enhancements |
533 | |
534 | In Cygwin Perl can now be built with threads (C<Configure -Duseithreads>). |
535 | This works with both Cygwin 1.3.22 and Cygwin 1.5.3. |
536 | |
537 | In newer FreeBSD releases Perl 5.8.0 compilation failed because of |
538 | trying to use F<malloc.h>, which in FreeBSD is just a dummy file, and |
539 | a fatal error to even try to use. Now F<malloc.h> is not used. |
540 | |
541 | Perl is now known to build also in Hitachi HI-UXMPP. |
542 | |
543 | Perl is now known to build again in LynxOS. |
544 | |
545 | Mac OS X now installs with Perl version number embedded in |
546 | installation directory names for easier upgrading of user-compiled |
547 | Perl, and the installation directories in general are more standard. |
548 | In other words, the default installation no longer breaks the |
549 | Apple-provided Perl. On the other hand, with C<Configure -Dprefix=/usr> |
550 | you can now really replace the Apple-supplied Perl (B<please be careful>). |
551 | |
552 | Mac OS X now builds Perl statically by default. This change was done |
553 | mainly for faster startup times. The Apple-provided Perl is still |
554 | dynamically linked and shared, and you can enable the sharedness for |
555 | your own Perl builds by C<Configure -Duseshrplib>. |
556 | |
557 | Perl has been ported to IBM's OS/400 PASE environment. The best way |
558 | to build a Perl for PASE is to use an AIX host as a cross-compilation |
559 | environment. See README.os400. |
560 | |
561 | Yet another cross-compilation option has been added: now Perl builds |
562 | on OpenZaurus, an Linux distribution based on Mandrake + Embedix for |
563 | the Sharp Zaurus PDA. See the Cross/README file. |
564 | |
565 | Tru64 when using gcc 3 drops the optimisation for F<toke.c> to C<-O2> |
566 | because of gigantic memory use with the default C<-O3>. |
567 | |
568 | Tru64 can now build Perl with the newer Berkeley DBs. |
569 | |
570 | Building Perl on WinCE has been much enhanced, see F<README.ce> |
571 | and F<README.perlce>. |
572 | |
573 | =head1 Selected Bug Fixes |
574 | |
575 | =head2 Closures, eval and lexicals |
576 | |
577 | There have been many fixes in the area of anonymous subs, lexicals and |
578 | closures. Although this means that Perl is now more "correct", it is |
579 | possible that some existing code will break that happens to rely on |
580 | the faulty behaviour. In practice this is unlikely unless your code |
581 | contains a very complex nesting of anonymous subs, evals and lexicals. |
582 | |
583 | =head2 Generic fixes |
584 | |
585 | If an input filehandle is marked C<:utf8> and Perl sees illegal UTF-8 |
586 | coming in when doing C<< <FH> >>, if warnings are enabled a warning is |
587 | immediately given - instead of being silent about it and Perl being |
588 | unhappy about the broken data later. (The C<:encoding(utf8)> layer |
589 | also works the same way.) |
590 | |
591 | binmode(SOCKET, ":utf8") only worked on the input side, not on the |
592 | output side of the socket. Now it works both ways. |
593 | |
594 | For threaded Perls certain system database functions like getpwent() |
595 | and getgrent() now grow their result buffer dynamically, instead of |
596 | failing. This means that at sites with lots of users and groups the |
597 | functions no longer fail by returning only partial results. |
598 | |
599 | Perl 5.8.0 had accidentally broken the capability for users |
600 | to define their own uppercase<->lowercase Unicode mappings |
601 | (as advertised by the Camel). This feature has been fixed and |
602 | is also documented better. |
603 | |
604 | In 5.8.0 this |
605 | |
606 | $some_unicode .= <FH>; |
607 | |
608 | didn't work correctly but instead corrupted the data. This has now |
609 | been fixed. |
610 | |
611 | Tied methods like FETCH etc. may now safely access tied values, i.e. |
612 | resulting in a recursive call to FETCH etc. Remember to break the |
613 | recursion, though. |
614 | |
615 | At startup Perl blocks the SIGFPE signal away since there isn't much |
616 | Perl can do about it. Previously this blocking was in effect also for |
617 | programs executed from within Perl. Now Perl restores the original |
618 | SIGFPE handling routine, whatever it was, before running external |
619 | programs. |
620 | |
621 | Linenumbers in Perl scripts may now be greater than 65536, or 2**16. |
622 | (Perl scripts have always been able to be larger than that, it's just |
623 | that the linenumber for reported errors and warnings have "wrapped |
624 | around".) While scripts that large usually indicate a need to rethink |
625 | your code a bit, such Perl scripts do exist, for example as results |
626 | from generated code. Now linenumbers can go all the way to |
627 | 4294967296, or 2**32. |
628 | |
629 | =head2 Platform-specific fixes |
630 | |
631 | Linux |
632 | |
633 | =over 4 |
634 | |
635 | =item * |
636 | |
637 | Setting $0 works again (with certain limitations that |
638 | Perl cannot do much about: see L<perlvar/$0>) |
639 | |
640 | =back |
641 | |
642 | HP-UX |
643 | |
644 | =over 4 |
645 | |
646 | =item * |
647 | |
648 | Setting $0 now works. |
649 | |
650 | =back |
651 | |
652 | VMS |
653 | |
654 | =over 4 |
655 | |
656 | =item * |
657 | |
658 | Configuration now tests for the presence of C<poll()>, and IO::Poll |
659 | now uses the vendor-supplied function if detected. |
660 | |
661 | =item * |
662 | |
663 | A rare access violation at Perl start-up could occur if the Perl image was |
664 | installed with privileges or if there was an identifier with the |
665 | subsystem attribute set in the process's rightslist. Either of these |
666 | circumstances triggered tainting code that contained a pointer bug. |
667 | The faulty pointer arithmetic has been fixed. |
668 | |
669 | =item * |
670 | |
671 | The length limit on values (not keys) in the %ENV hash has been raised |
672 | from 255 bytes to 32640 bytes (except when the PERL_ENV_TABLES setting |
673 | overrides the default use of logical names for %ENV). If it is |
674 | necessary to access these long values from outside Perl, be aware that |
675 | they are implemented using search list logical names that store the |
676 | value in pieces, each 255-byte piece (up to 128 of them) being an |
677 | element in the search list. When doing a lookup in %ENV from within |
678 | Perl, the elements are combined into a single value. The existing |
679 | VMS-specific ability to access individual elements of a search list |
680 | logical name via the $ENV{'foo;N'} syntax (where N is the search list |
681 | index) is unimpaired. |
682 | |
683 | =item * |
684 | |
685 | The piping implementation now uses local rather than global DCL |
686 | symbols for inter-process communication. |
687 | |
688 | =item * |
689 | |
690 | File::Find could become confused when navigating to a relative |
691 | directory whose name collided with a logical name. This problem has |
692 | been corrected by adding directory syntax to relative path names, thus |
693 | preventing logical name translation. |
694 | |
695 | =back |
696 | |
697 | Win32 |
698 | |
699 | =over 4 |
700 | |
701 | =item * |
702 | |
703 | A memory leak in the fork() emulation has been fixed. |
704 | |
705 | =item * |
706 | |
707 | The return value of the ioctl() built-in function was accidentally |
708 | broken in 5.8.0. This has been corrected. |
709 | |
710 | =item * |
711 | |
712 | The internal message loop executed by perl during blocking operations |
713 | sometimes interfered with messages that were external to Perl. |
714 | This often resulted in blocking operations terminating prematurely or |
715 | returning incorrect results, when Perl was executing under environments |
716 | that could generate Windows messages. This has been corrected. |
717 | |
718 | =item * |
719 | |
720 | Pipes and sockets are now automatically in binary mode. |
721 | |
722 | =item * |
723 | |
724 | The four-argument form of select() did not preserve $! (errno) properly |
725 | when there were errors in the underlying call. This is now fixed. |
726 | |
727 | =item * |
728 | |
729 | The "CR CR LF" problem of has been fixed, binmode(FH, ":crlf") |
730 | is now effectively a no-op. |
731 | |
732 | =back |
733 | |
734 | =head1 New or Changed Diagnostics |
735 | |
736 | All the warnings related to pack() and unpack() were made more |
737 | informative and consistent. |
738 | |
739 | =head2 Changed "A thread exited while %d threads were running" |
740 | |
741 | The old version |
742 | |
743 | A thread exited while %d other threads were still running |
744 | |
745 | was misleading because the "other" included also the thread giving |
746 | the warning. |
747 | |
748 | =head2 Removed "Attempt to clear a restricted hash" |
749 | |
750 | It is not illegal to clear a restricted hash, so the warning |
751 | was removed. |
752 | |
753 | =head2 New "Illegal declaration of anonymous subroutine" |
754 | |
755 | You must specify the block of code for C<sub>. |
756 | |
757 | =head2 Changed "Invalid range "%s" in transliteration operator" |
758 | |
759 | The old version |
760 | |
761 | Invalid [] range "%s" in transliteration operator |
762 | |
763 | was simply wrong because there are no "[] ranges" in tr///. |
764 | |
765 | =head2 New "Missing control char name in \c" |
766 | |
767 | Self-explanatory. |
768 | |
769 | =head2 New "Newline in left-justified string for %s" |
770 | |
771 | The padding spaces would appear after the newline, which is |
772 | probably not what you had in mind. |
773 | |
774 | =head2 New "Possible precedence problem on bitwise %c operator" |
775 | |
776 | If you think this |
777 | |
778 | $x & $y == 0 |
779 | |
780 | tests whether the bitwise AND of $x and $y is zero, |
781 | you will like this warning. |
782 | |
783 | =head2 New "Pseudo-hashes are deprecated" |
784 | |
785 | This warning should have been already in 5.8.0, since they are. |
786 | |
787 | =head2 New "read() on %s filehandle %s" |
788 | |
789 | You cannot read() (or sysread()) from a closed or unopened filehandle. |
790 | |
791 | =head2 New "5.005 threads are deprecated" |
792 | |
793 | This warning should have been already in 5.8.0, since they are. |
794 | |
795 | =head2 New "Tied variable freed while still in use" |
796 | |
797 | Something pulled the plug on a live tied variable, Perl plays |
798 | safe by bailing out. |
799 | |
800 | =head2 New "To%s: illegal mapping '%s'" |
801 | |
802 | An illegal user-defined Unicode casemapping was specified. |
803 | |
804 | =head2 New "Use of freed value in iteration" |
805 | |
806 | Something modified the values being iterated over. This is not good. |
807 | |
808 | =head1 Changed Internals |
809 | |
810 | These news matter to you only if you either write XS code or like to |
811 | know about or hack Perl internals (using Devel::Peek or any of the |
812 | C<B::> modules counts), or like to run Perl with the C<-D> option. |
813 | |
814 | The embedding examples of L<perlembed> have been reviewed to be |
815 | uptodate and consistent: for example, the correct use of |
816 | PERL_SYS_INIT3() and PERL_SYS_TERM(). |
817 | |
818 | Extensive reworking of the pad code (the code responsible |
819 | for lexical variables) has been conducted by Dave Mitchell. |
820 | |
821 | Extensive work on the v-strings by John Peacock. |
822 | |
823 | UTF-8 length and position cache: to speed up the handling of Unicode |
824 | (UTF-8) scalars, a cache was introduced. Potential problems exist if |
825 | an extension bypasses the official APIs and directly modifies the PV |
826 | of an SV: the UTF-8 cache does not get cleared as it should. |
827 | |
828 | APIs obsoleted in Perl 5.8.0, like sv_2pv, sv_catpvn, sv_catsv, |
829 | sv_setsv, are again available. |
830 | |
831 | Certain Perl core C APIs like cxinc and regatom are no longer |
832 | available at all to code outside the Perl core of the Perl core |
833 | extensions. This is intentional. They never should have been |
834 | available with the shorter names, and if you application depends on |
835 | them, you should (be ashamed and) contact perl5-porters to discuss |
836 | what are the proper APIs. |
837 | |
838 | Certain Perl core C APIs like C<Perl_list> are no longer available |
839 | without their C<Perl_> prefix. If your XS module stops working |
840 | because some functions cannot be found, in many cases a simple fix is |
841 | to add the C<Perl_> prefix to the function and the thread context |
842 | C<aTHX_> as the first argument of the function call. This is also how |
843 | it should always have been done: letting the Perl_-less forms to leak |
844 | from the core was an accident. For cleaner embedding you can also |
845 | force this for all APIs by defining at compile time the cpp define |
846 | PERL_NO_SHORT_NAMES. |
847 | |
848 | Perl_save_bool() has been added. |
849 | |
850 | Regexp objects (those created with C<qr>) now have S-magic rather than |
851 | R-magic. This fixed regexps of the form /...(??{...;$x})/ to no |
852 | longer ignore changes made to $x. The S-magic avoids dropping |
853 | the caching optimization and making (??{...}) constructs obscenely |
854 | slow (and consequently useless). See also L<perlguts/"Magic Variables">. |
855 | Regexp::Copy was affected by this change. |
856 | |
857 | The Perl internal debugging macros DEBUG() and DEB() have been renamed |
858 | to PERL_DEBUG() and PERL_DEB() to avoid namespace conflicts. |
859 | |
860 | C<-DL> removed (the leaktest had been broken and unsupported for years, |
861 | use alternative debugging mallocs or tools like valgrind and Purify). |
862 | |
863 | Verbose modifier C<v> added for C<-DXv> and C<-Dsv>, see L<perlrun>. |
864 | |
865 | =head1 New Tests |
866 | |
867 | In Perl 5.8.0 there were about 69000 separate tests in about 700 test files, |
868 | in Perl 5.8.1 there are about 77000 separate tests in about 780 test files. |
869 | The exact numbers depend on the Perl configuration and on the operating |
870 | system platform. |
871 | |
872 | =head1 Known Problems |
873 | |
874 | The hash randomisation mentioned in L</Incompatible Changes> is definitely |
875 | problematic: it will wake dormant bugs and shake out bad assumptions. |
876 | |
877 | If you want to use mod_perl 2.x with Perl 5.8.1, you will need |
878 | mod_perl-1.99_10 or higher. Earlier versions of mod_perl 2.x |
879 | do not work with the randomised hashes. (mod_perl 1.x works fine.) |
880 | You will also need Apache::Test 1.04 or higher. |
881 | |
882 | Many of the rarer platforms that worked 100% or pretty close to it |
883 | with perl 5.8.0 have been left a little bit untended since their |
884 | maintainers have been otherwise busy lately, and therefore there will |
885 | be more failures on those platforms. Such platforms include Mac OS |
886 | Classic, IBM z/OS (and other EBCDIC platforms), and NetWare. The most |
887 | common Perl platforms (Unix and Unix-like, Microsoft platforms, and |
888 | VMS) have large enough testing and expert population that they are |
889 | doing well. |
890 | |
891 | =head2 Tied hashes in scalar context |
892 | |
893 | Tied hashes do not currently return anything useful in scalar context, |
894 | for example when used as boolean tests: |
895 | |
896 | if (%tied_hash) { ... } |
897 | |
898 | The current nonsensical behaviour is always to return false, |
899 | regardless of whether the hash is empty or has elements. |
900 | |
901 | The root cause is that there is no interface for the implementors of |
902 | tied hashes to implement the behaviour of a hash in scalar context. |
903 | |
904 | =head2 Net::Ping 450_service and 510_ping_udp failures |
905 | |
906 | The subtests 9 and 18 of lib/Net/Ping/t/450_service.t, and the |
907 | subtest 2 of lib/Net/Ping/t/510_ping_udp.t might fail if you have |
908 | an unusual networking setup. For example in the latter case the |
909 | test is trying to send a UDP ping to the IP address 127.0.0.1. |
910 | |
911 | =head2 B::C |
912 | |
913 | The C-generating compiler backend B::C (the frontend being |
914 | C<perlcc -c>) is even more broken than it used to be because of |
915 | the extensive lexical variable changes. (The good news is that |
916 | B::Bytecode and ByteLoader are better than they used to be.) |
917 | |
918 | =head1 Platform Specific Problems |
919 | |
920 | =head2 EBCDIC Platforms |
921 | |
922 | IBM z/OS and other EBCDIC platforms continue to be problematic |
923 | regarding Unicode support. Many Unicode tests are skipped when |
924 | they really should be fixed. |
925 | |
926 | =head2 Cygwin 1.5 problems |
927 | |
928 | In Cygwin 1.5 the F<io/tell> and F<op/sysio> tests have failures for |
929 | some yet unknown reason. In 1.5.5 the threads tests stress_cv, |
930 | stress_re, and stress_string are failing unless the environment |
931 | variable PERLIO is set to "perlio" (which makes also the io/tell |
932 | failure go away). |
933 | |
934 | Perl 5.8.1 does build and work well with Cygwin 1.3: with (uname -a) |
935 | C<CYGWIN_NT-5.0 ... 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 ...> |
936 | a 100% "make test" was achieved with C<Configure -des -Duseithreads>. |
937 | |
938 | =head2 HP-UX: HP cc warnings about sendfile and sendpath |
939 | |
940 | With certain HP C compiler releases (e.g. B.11.11.02) you will |
941 | get many warnings like this (lines wrapped for easier reading): |
942 | |
943 | cc: "/usr/include/sys/socket.h", line 504: warning 562: |
944 | Redeclaration of "sendfile" with a different storage class specifier: |
945 | "sendfile" will have internal linkage. |
946 | cc: "/usr/include/sys/socket.h", line 505: warning 562: |
947 | Redeclaration of "sendpath" with a different storage class specifier: |
948 | "sendpath" will have internal linkage. |
949 | |
950 | The warnings show up both during the build of Perl and during certain |
951 | lib/ExtUtils tests that invoke the C compiler. The warning, however, |
952 | is not serious and can be ignored. |
953 | |
954 | =head2 IRIX: t/uni/tr_7jis.t falsely failing |
955 | |
956 | The test t/uni/tr_7jis.t is known to report failure under 'make test' |
957 | or the test harness with certain releases of IRIX (at least IRIX 6.5 |
958 | and MIPSpro Compilers Version 7.3.1.1m), but if run manually the test |
959 | fully passes. |
960 | |
961 | =head2 Mac OS X: no usemymalloc |
962 | |
963 | The Perl malloc (C<-Dusemymalloc>) does not work at all in Mac OS X. |
964 | This is not that serious, though, since the native malloc works just |
965 | fine. |
966 | |
967 | =head2 Tru64: No threaded builds with GNU cc (gcc) |
968 | |
969 | In the latest Tru64 releases (e.g. v5.1B or later) gcc cannot be used |
970 | to compile a threaded Perl (-Duseithreads) because the system |
971 | C<< <pthread.h> >> file doesn't know about gcc. |
972 | |
973 | =head2 Win32: sysopen, sysread, syswrite |
974 | |
975 | As of the 5.8.0 release, sysopen()/sysread()/syswrite() do not behave |
976 | like they used to in 5.6.1 and earlier with respect to "text" mode. |
977 | These built-ins now always operate in "binary" mode (even if sysopen() |
978 | was passed the O_TEXT flag, or if binmode() was used on the file |
979 | handle). Note that this issue should only make a difference for disk |
980 | files, as sockets and pipes have always been in "binary" mode in the |
981 | Windows port. As this behavior is currently considered a bug, |
982 | compatible behavior may be re-introduced in a future release. Until |
983 | then, the use of sysopen(), sysread() and syswrite() is not supported |
984 | for "text" mode operations. |
985 | |
986 | =head1 Future Directions |
987 | |
988 | The following things B<might> happen in future. The first publicly |
989 | available releases having these characteristics will be the developer |
990 | releases Perl 5.9.x, culminating in the Perl 5.10.0 release. These |
991 | are our best guesses at the moment: we reserve the right to rethink. |
992 | |
993 | =over 4 |
994 | |
995 | =item * |
996 | |
997 | PerlIO will become The Default. Currently (in Perl 5.8.x) the stdio |
998 | library is still used if Perl thinks it can use certain tricks to |
999 | make stdio go B<really> fast. For future releases our goal is to |
1000 | make PerlIO go even faster. |
1001 | |
1002 | =item * |
1003 | |
1004 | A new feature called I<assertions> will be available. This means that |
1005 | one can have code called assertions sprinkled in the code: usually |
1006 | they are optimised away, but they can be enabled with the C<-A> option. |
1007 | |
1008 | =item * |
1009 | |
1010 | A new operator C<//> (defined-or) will be available. This means that |
1011 | one will be able to say |
1012 | |
1013 | $a // $b |
1014 | |
1015 | instead of |
1016 | |
1017 | defined $a ? $a : $b |
1018 | |
1019 | and |
1020 | |
1021 | $c //= $d; |
1022 | |
1023 | instead of |
1024 | |
1025 | $c = $d unless defined $c; |
1026 | |
1027 | The operator will have the same precedence and associativity as C<||>. |
1028 | A source code patch against the Perl 5.8.1 sources will be available |
1029 | in CPAN as F<authors/id/H/HM/HMBRAND/dor-5.8.1.diff>. |
1030 | |
1031 | =item * |
1032 | |
1033 | C<unpack()> will default to unpacking the C<$_>. |
1034 | |
1035 | =item * |
1036 | |
1037 | Various Copy-On-Write techniques will be investigated in hopes |
1038 | of speeding up Perl. |
1039 | |
1040 | =item * |
1041 | |
1042 | CPANPLUS, Inline, and Module::Build will become core modules. |
1043 | |
1044 | =item * |
1045 | |
1046 | The ability to write true lexically scoped pragmas will be introduced. |
1047 | |
1048 | =item * |
1049 | |
1050 | Work will continue on the bytecompiler and byteloader. |
1051 | |
1052 | =item * |
1053 | |
1054 | v-strings as they currently exist are scheduled to be deprecated. The |
1055 | v-less form (1.2.3) will become a "version object" when used with C<use>, |
1056 | C<require>, and C<$VERSION>. $^V will also be a "version object" so the |
1057 | printf("%vd",...) construct will no longer be needed. The v-ful version |
1058 | (v1.2.3) will become obsolete. The equivalence of strings and v-strings (e.g. |
1059 | that currently 5.8.0 is equal to "\5\8\0") will go away. B<There may be no |
1060 | deprecation warning for v-strings>, though: it is quite hard to detect when |
1061 | v-strings are being used safely, and when they are not. |
1062 | |
1063 | =item * |
1064 | |
1065 | 5.005 Threads Will Be Removed |
1066 | |
1067 | =item * |
1068 | |
1069 | The C<$*> Variable Will Be Removed |
1070 | (it was deprecated a long time ago) |
1071 | |
1072 | =item * |
1073 | |
1074 | Pseudohashes Will Be Removed |
1075 | |
1076 | =back |
1077 | |
1078 | =head1 Reporting Bugs |
1079 | |
1080 | If you find what you think is a bug, you might check the articles |
1081 | recently posted to the comp.lang.perl.misc newsgroup and the perl |
1082 | bug database at http://bugs.perl.org/ . There may also be |
1083 | information at http://www.perl.com/ , the Perl Home Page. |
1084 | |
1085 | If you believe you have an unreported bug, please run the B<perlbug> |
1086 | program included with your release. Be sure to trim your bug down |
1087 | to a tiny but sufficient test case. Your bug report, along with the |
1088 | output of C<perl -V>, will be sent off to perlbug@perl.org to be |
1089 | analysed by the Perl porting team. You can browse and search |
1090 | the Perl 5 bugs at http://bugs.perl.org/ |
1091 | |
1092 | =head1 SEE ALSO |
1093 | |
1094 | The F<Changes> file for exhaustive details on what changed. |
1095 | |
1096 | The F<INSTALL> file for how to build Perl. |
1097 | |
1098 | The F<README> file for general stuff. |
1099 | |
1100 | The F<Artistic> and F<Copying> files for copyright information. |
1101 | |
1102 | =cut |