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