Root is the lizard king.
[p5sagit/p5-mst-13.2.git] / pod / perldelta.pod
CommitLineData
ba370e9b 1=head1 NAME
cc0fca54 2
f39f21d8 3perldelta - what is new for perl v5.8.0
cc0fca54 4
5=head1 DESCRIPTION
6
44da0e71 7This document describes differences between the 5.6.0 release
8and the 5.8.0 release.
f39f21d8 9
44da0e71 10Many of the bug fixes in 5.8.0 were already seen in the 5.6.1
11maintenance release since the two releases were kept closely
12coordinated.
13
4f8e5944 14If you are upgrading from Perl 5.005_03, you might also want
15to read L<perl56delta>.
16
44da0e71 17=head1 Highlights In 5.8.0
76663d67 18
19=over 4
20
21=item *
22
23Better Unicode support
24
25=item *
26
27New Thread Implementation
28
29=item *
30
31Many New Modules
32
33=item *
34
35Better Numeric Accuracy
36
37=item *
38
39Safe Signals
40
41=item *
42
43More Extensive Regression Testing
44
45=back
46
f39f21d8 47=head1 Incompatible Changes
48
77c8cf41 49=head2 64-bit platforms and malloc
50
057b7f2b 51If your pointers are 64 bits wide, the Perl malloc is no longer being
c2e23569 52used because it does not work well with 8-byte pointers. Also,
61947107 53usually the system mallocs on such platforms are much better optimized
c2e23569 54for such large memory models than the Perl malloc. Some memory-hungry
55Perl applications like the PDL don't work well with Perl's malloc.
56Finally, other applications than Perl (like modperl) tend to prefer
57the system malloc. Such platforms include Alpha and 64-bit HPPA,
58MIPS, PPC, and Sparc.
77c8cf41 59
60=head2 AIX Dynaloading
61
62The AIX dynaloading now uses in AIX releases 4.3 and newer the native
63dlopen interface of AIX instead of the old emulated interface. This
64change will probably break backward compatibility with compiled
65modules. The change was made to make Perl more compliant with other
66applications like modperl which are using the AIX native interface.
67
95f0a2f1 68=head2 Attributes for C<my> variables now handled at run-time.
69
70The C<my EXPR : ATTRS> syntax now applies variable attributes at
71run-time. (Subroutine and C<our> variables still get attributes applied
72at compile-time.) See L<attributes> for additional details. In particular,
73however, this allows variable attributes to be useful for C<tie> interfaces,
c4f1ce08 74which was a deficiency of earlier releases. Note that the new semantics
75doesn't work with the Attribute::Handlers module (as of version 0.76).
95f0a2f1 76
77c8cf41 77=head2 Socket Extension Dynamic in VMS
78
79The Socket extension is now dynamically loaded instead of being
80statically built in. This may or may not be a problem with ancient
81TCP/IP stacks of VMS: we do not know since we weren't able to test
82Perl in such configurations.
83
00bb525a 84=head2 IEEE-format Floating Point Default on OpenVMS Alpha
85
86Perl now uses IEEE format (T_FLOAT) as the default internal floating
87point format on OpenVMS Alpha, potentially breaking binary compatibility
88with external libraries or existing data. G_FLOAT is still available as
89a configuration option. The default on VAX (D_FLOAT) has not changed.
90
77c8cf41 91=head2 Different Definition of the Unicode Character Classes \p{In...}
92
93As suggested by the Unicode consortium, the Unicode character classes
94now prefer I<scripts> as opposed to I<blocks> (as defined by Unicode);
95in Perl, when the C<\p{In....}> and the C<\p{In....}> regular expression
96constructs are used. This has changed the definition of some of those
97character classes.
98
99The difference between scripts and blocks is that scripts are the
100glyphs used by a language or a group of languages, while the blocks
101are more artificial groupings of 256 characters based on the Unicode
102numbering.
103
104In general this change results in more inclusive Unicode character
105classes, but changes to the other direction also do take place:
106for example while the script C<Latin> includes all the Latin
107characters and their various diacritic-adorned versions, it
108does not include the various punctuation or digits (since they
109are not solely C<Latin>).
110
111Changes in the character class semantics may have happened if a script
112and a block happen to have the same name, for example C<Hebrew>.
113In such cases the script wins and C<\p{InHebrew}> now means the script
114definition of Hebrew. The block definition in still available,
115though, by appending C<Block> to the name: C<\p{InHebrewBlock}> means
116what C<\p{InHebrew}> meant in perl 5.6.0. For the full list
117of affected character classes, see L<perlunicode/Blocks>.
118
61947107 119=head2 Perl Parser Stress Tested
120
121The Perl parser has been stress tested using both random input and
122Markov chain input and the few found crashes and lockups have been
123fixed.
124
c2e23569 125=head2 REF(...) Instead Of SCALAR(...)
77c8cf41 126
057b7f2b 127A reference to a reference now stringifies as "REF(0x81485ec)" instead
c2e23569 128of "SCALAR(0x81485ec)" in order to be more consistent with the return
129value of ref().
77c8cf41 130
c2e23569 131=head2 Deprecations
77c8cf41 132
61947107 133=over 4
77c8cf41 134
61947107 135=item *
f39f21d8 136
61947107 137The semantics of bless(REF, REF) were unclear and until someone proves
138it to make some sense, it is forbidden.
f39f21d8 139
140=item *
141
c2e23569 142The obsolete chat2 library that should never have been allowed
143to escape the laboratory has been decommissioned.
f39f21d8 144
145=item *
146
61947107 147The very dusty examples in the eg/ directory have been removed.
148Suggestions for new shiny examples welcome but the main issue is that
149the examples need to be documented, tested and (most importantly)
150maintained.
f39f21d8 151
152=item *
153
c2e23569 154The (bogus) escape sequences \8 and \9 now give an optional warning
155("Unrecognized escape passed through"). There is no need to \-escape
156any C<\w> character.
f39f21d8 157
158=item *
159
c2e23569 160The list of filenames from glob() (or <...>) is now by default sorted
44da0e71 161alphabetically to be csh-compliant (which is what happened before
162in most UNIX platforms). (bsd_glob() does still sort platform
c2e23569 163natively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.)
f39f21d8 164
165=item *
166
44da0e71 167Spurious syntax errors generated in certain situations, when glob()
168caused File::Glob to be loaded for the first time, have been fixed.
169
170=item *
171
c2e23569 172Although "you shouldn't do that", it was possible to write code that
173depends on Perl's hashed key order (Data::Dumper does this). The new
174algorithm "One-at-a-Time" produces a different hashed key order.
175More details are in L</"Performance Enhancements">.
f39f21d8 176
177=item *
178
61947107 179lstat(FILEHANDLE) now gives a warning because the operation makes no sense.
180In future releases this may become a fatal error.
f39f21d8 181
182=item *
183
057b7f2b 184The C<package;> syntax (C<package> without an argument) has been
c2e23569 185deprecated. Its semantics were never that clear and its
186implementation even less so. If you have used that feature to
187disallow all but fully qualified variables, C<use strict;> instead.
61947107 188
189=item *
190
c2e23569 191The unimplemented POSIX regex features [[.cc.]] and [[=c=]] are still
192recognised but now cause fatal errors. The previous behaviour of
193ignoring them by default and warning if requested was unacceptable
194since it, in a way, falsely promised that the features could be used.
61947107 195
196=item *
197
c2e23569 198The current user-visible implementation of pseudo-hashes (the weird
199use of the first array element) is deprecated starting from Perl 5.8.0
200and will be removed in Perl 5.10.0, and the feature will be
201implemented differently. Not only is the current interface rather
202ugly, but the current implementation slows down normal array and hash
203use quite noticeably. The C<fields> pragma interface will remain
204available.
61947107 205
206=item *
207
aecce728 208The syntaxes C<< @a->[...] >> and C<< %h->{...} >> have now been deprecated.
61947107 209
210=item *
211
c2e23569 212After years of trying the suidperl is considered to be too complex to
213ever be considered truly secure. The suidperl functionality is likely
214to be removed in a future release.
215
216=item *
217
218The long deprecated uppercase aliases for the string comparison
219operators (EQ, NE, LT, LE, GE, GT) have now been removed.
220
221=item *
222
223The tr///C and tr///U features have been removed and will not return;
224the interface was a mistake. Sorry about that. For similar
225functionality, see pack('U0', ...) and pack('C0', ...).
f39f21d8 226
227=back
228
61947107 229=head1 Core Enhancements
230
77c8cf41 231=head2 PerlIO is Now The Default
f39f21d8 232
233=over 4
234
235=item *
236
77c8cf41 237IO is now by default done via PerlIO rather than system's "stdio".
238PerlIO allows "layers" to be "pushed" onto a file handle to alter the
239handle's behaviour. Layers can be specified at open time via 3-arg
240form of open:
f39f21d8 241
77c8cf41 242 open($fh,'>:crlf :utf8', $path) || ...
f39f21d8 243
77c8cf41 244or on already opened handles via extended C<binmode>:
f39f21d8 245
77c8cf41 246 binmode($fh,':encoding(iso-8859-7)');
f39f21d8 247
77c8cf41 248The built-in layers are: unix (low level read/write), stdio (as in
249previous Perls), perlio (re-implementation of stdio buffering in a
250portable manner), crlf (does CRLF <=> "\n" translation as on Win32,
251but available on any platform). A mmap layer may be available if
252platform supports it (mostly UNIXes).
f39f21d8 253
77c8cf41 254Layers to be applied by default may be specified via the 'open' pragma.
255
256See L</"Installation and Configuration Improvements"> for the effects
257of PerlIO on your architecture name.
f39f21d8 258
259=item *
260
77c8cf41 261File handles can be marked as accepting Perl's internal encoding of Unicode
262(UTF-8 or UTF-EBCDIC depending on platform) by a pseudo layer ":utf8" :
f39f21d8 263
77c8cf41 264 open($fh,">:utf8","Uni.txt");
f39f21d8 265
77c8cf41 266Note for EBCDIC users: the pseudo layer ":utf8" is erroneously named
267for you since it's not UTF-8 what you will be getting but instead
268UTF-EBCDIC. See L<perlunicode>, L<utf8>, and
269http://www.unicode.org/unicode/reports/tr16/ for more information.
270In future releases this naming may change.
f39f21d8 271
272=item *
273
77c8cf41 274File handles can translate character encodings from/to Perl's internal
275Unicode form on read/write via the ":encoding()" layer.
f39f21d8 276
277=item *
278
77c8cf41 279File handles can be opened to "in memory" files held in Perl scalars via:
280
281 open($fh,'>', \$variable) || ...
f39f21d8 282
283=item *
284
77c8cf41 285Anonymous temporary files are available without need to
286'use FileHandle' or other module via
f39f21d8 287
77c8cf41 288 open($fh,"+>", undef) || ...
f39f21d8 289
77c8cf41 290That is a literal undef, not an undefined value.
f39f21d8 291
292=item *
293
77c8cf41 294The list form of C<open> is now implemented for pipes (at least on UNIX):
f39f21d8 295
77c8cf41 296 open($fh,"-|", 'cat', '/etc/motd')
f39f21d8 297
77c8cf41 298creates a pipe, and runs the equivalent of exec('cat', '/etc/motd') in
299the child process.
f39f21d8 300
e1f170bd 301=back
f39f21d8 302
e1f170bd 303=head2 Signals Are Now Safe
f39f21d8 304
e1f170bd 305Perl used to be fragile in that signals arriving at inopportune moments
306could corrupt Perl's internal state. Now Perl postpones handling of
307signals until it's safe.
f39f21d8 308
e1f170bd 309=head2 Unicode Overhaul
f39f21d8 310
e1f170bd 311Unicode in general should be now much more usable than in Perl 5.6.0
312(or even in 5.6.1). Unicode can be used in hash keys, Unicode in
313regular expressions should work now, Unicode in tr/// should work now,
314Unicode in I/O should work now.
f39f21d8 315
e1f170bd 316=over 4
f39f21d8 317
318=item *
319
e1f170bd 320The Unicode Character Database coming with Perl has been upgraded
321to Unicode 3.1.1. For more information, see http://www.unicode.org/.
f39f21d8 322
323=item *
324
77c8cf41 325For developers interested in enhancing Perl's Unicode capabilities:
326almost all the UCD files are included with the Perl distribution in
e1f170bd 327the lib/unicore subdirectory. The most notable omission, for space
77c8cf41 328considerations, is the Unihan database.
f39f21d8 329
330=item *
331
77c8cf41 332The Unicode character classes \p{Blank} and \p{SpacePerl} have been
333added. "Blank" is like C isblank(), that is, it contains only
334"horizontal whitespace" (the space character is, the newline isn't),
335and the "SpacePerl" is the Unicode equivalent of C<\s> (\p{Space}
336isn't, since that includes the vertical tabulator character, whereas
337C<\s> doesn't.)
f39f21d8 338
339=back
340
77c8cf41 341=head2 Understanding of Numbers
342
343In general a lot of fixing has happened in the area of Perl's
344understanding of numbers, both integer and floating point. Since in
345many systems the standard number parsing functions like C<strtoul()>
346and C<atof()> seem to have bugs, Perl tries to work around their
347deficiencies. This results hopefully in more accurate numbers.
f39f21d8 348
e1f170bd 349Perl now tries internally to use integer values in numeric conversions
350and basic arithmetics (+ - * /) if the arguments are integers, and
351tries also to keep the results stored internally as integers.
057b7f2b 352This change leads to often slightly faster and always less lossy
e1f170bd 353arithmetics. (Previously Perl always preferred floating point numbers
354in its math.)
355
356=head2 Miscellaneous Enhancements
357
f39f21d8 358=over 4
359
360=item *
361
e1f170bd 362AUTOLOAD is now lvaluable, meaning that you can add the :lvalue attribute
363to AUTOLOAD subroutines and you can assign to the AUTOLOAD return value.
364
365=item *
366
61947107 367C<perl -d:Module=arg,arg,arg> now works (previously one couldn't pass
368in multiple arguments.)
f39f21d8 369
370=item *
371
61947107 372END blocks are now run even if you exit/die in a BEGIN block.
373Internally, the execution of END blocks is now controlled by
374PL_exit_flags & PERL_EXIT_DESTRUCT_END. This enables the new
375behaviour for Perl embedders. This will default in 5.10. See
376L<perlembed>.
f39f21d8 377
378=item *
379
e1f170bd 380Formats now support zero-padded decimal fields.
f39f21d8 381
382=item *
383
77c8cf41 384Lvalue subroutines can now return C<undef> in list context.
44da0e71 385However, the lvalue subroutine feature still remains experimental.
f39f21d8 386
387=item *
388
61947107 389A new special regular expression variable has been introduced:
390C<$^N>, which contains the most-recently closed group (submatch).
f39f21d8 391
392=item *
393
61947107 394C<no Module;> now works even if there is no "sub unimport" in the Module.
f39f21d8 395
396=item *
397
61947107 398The numerical comparison operators return C<undef> if either operand
399is a NaN. Previously the behaviour was unspecified.
f39f21d8 400
401=item *
402
e1f170bd 403The following builtin functions are now overridable: each(), keys(),
404pop(), push(), shift(), splice(), unshift().
405
406=item *
407
61947107 408C<pack('U0a*', ...)> can now be used to force a string to UTF8.
f39f21d8 409
410=item *
411
61947107 412my __PACKAGE__ $obj now works.
f39f21d8 413
414=item *
415
e1f170bd 416The printf() and sprintf() now support parameter reordering using the
417C<%\d+\$> and C<*\d+\$> syntaxes. For example
418
419 print "%2\$s %1\$s\n", "foo", "bar";
420
da6838c8 421will print "bar foo\n". This feature helps in writing
422internationalised software, and in general when the order
423of the parameters can vary.
f39f21d8 424
425=item *
426
e1f170bd 427prototype(\&) is now available.
61947107 428
429=item *
430
e1f170bd 431prototype(\[$@%&]) is now available to implicitly create references
432(useful for example if you want to emulate the tie() interface).
61947107 433
434=item *
435
44da0e71 436untie() will now call an UNTIE() hook if it exists. See L<perltie>
437for details.
61947107 438
439=item *
440
441L<utime> now supports C<utime undef, undef, @files> to change the
442file timestamps to the current time.
443
444=item *
445
e1f170bd 446The rules for allowing underscores (underbars) in numeric constants
447have been relaxed and simplified: now you can have an underscore
448simply B<between digits>.
f39f21d8 449
450=back
451
77c8cf41 452=head1 Modules and Pragmata
f39f21d8 453
1e13d81f 454=head2 New Modules and Pragmata
f39f21d8 455
456=over 4
457
458=item *
459
61947107 460B<B::Concise> is a new compiler backend for walking the Perl syntax
461tree, printing concise info about ops, from Stephen McCamant. The
462output is highly customisable. See L<B::Concise>.
f39f21d8 463
464=item *
465
61947107 466C<Class::ISA> for reporting the search path for a class's ISA tree,
467by Sean Burke, has been added. See L<Class::ISA>.
f39f21d8 468
469=item *
470
61947107 471C<Cwd> has now a split personality: if possible, an XS extension is
472used, (this will hopefully be faster, more secure, and more robust)
473but if not possible, the familiar Perl implementation is used.
f39f21d8 474
475=item *
476
e1f170bd 477C<Devel::PPPort>, originally from Kenneth Albanowski and now
478maintained by Paul Marquess, has been added. It is primarily used
479by C<h2xs> to enhance portability of of XS modules between different
480versions of Perl.
1e13d81f 481
482=item *
483
61947107 484C<Digest>, frontend module for calculating digests (checksums), from
485Gisle Aas, has been added. See L<Digest>.
f39f21d8 486
487=item *
488
61947107 489C<Digest::MD5> for calculating MD5 digests (checksums) as defined in
490RFC 1321, from Gisle Aas, has been added. See L<Digest::MD5>.
f39f21d8 491
492 use Digest::MD5 'md5_hex';
493
494 $digest = md5_hex("Thirsty Camel");
495
496 print $digest, "\n"; # 01d19d9d2045e005c3f1b80e8b164de1
497
61947107 498NOTE: the C<MD5> backward compatibility module is deliberately not
e1f170bd 499included since its further use is discouraged.
f39f21d8 500
f39f21d8 501=item *
502
61947107 503C<Encode>, by Nick Ing-Simmons, provides a mechanism to translate
f39f21d8 504between different character encodings. Support for Unicode,
505ISO-8859-*, ASCII, CP*, KOI8-R, and three variants of EBCDIC are
506compiled in to the module. Several other encodings (like Japanese,
507Chinese, and MacIntosh encodings) are included and will be loaded at
61947107 508runtime. See L<Encode>.
f39f21d8 509
510Any encoding supported by Encode module is also available to the
511":encoding()" layer if PerlIO is used.
512
61947107 513=item *
514
515C<I18N::Langinfo> can be use to query locale information.
516See L<I18N::Langinfo>.
f39f21d8 517
518=item *
519
61947107 520C<I18N::LangTags> has functions for dealing with RFC3066-style
bea4d472 521language tags, by Sean Burke. See L<I18N::LangTags>.
61947107 522
523=item *
524
525C<ExtUtils::Constant> is a new tool for extension writers for
526generating XS code to import C header constants, by Nicholas Clark.
527See L<ExtUtils::Constant>.
528
529=item *
530
531C<Filter::Simple> is an easy-to-use frontend to Filter::Util::Call,
532from Damian Conway. See L<Filter::Simple>.
f39f21d8 533
534 # in MyFilter.pm:
535
536 package MyFilter;
537
538 use Filter::Simple sub {
539 while (my ($from, $to) = splice @_, 0, 2) {
540 s/$from/$to/g;
541 }
542 };
543
544 1;
545
546 # in user's code:
547
548 use MyFilter qr/red/ => 'green';
549
550 print "red\n"; # this code is filtered, will print "green\n"
551 print "bored\n"; # this code is filtered, will print "bogreen\n"
552
553 no MyFilter;
554
555 print "red\n"; # this code is not filtered, will print "red\n"
556
61947107 557=item *
558
559C<File::Temp> allows one to create temporary files and directories in
560an easy, portable, and secure way, by Tim Jenness. See L<File::Temp>.
561
562=item *
563
564C<Filter::Util::Call> provides you with the framework to write
565I<Source Filters> in Perl, from Paul Marquess. For most uses the
566frontend Filter::Simple is to be preferred. See L<Filter::Util::Call>.
567
568=item *
569
570L<libnet> is a collection of perl5 modules related to network
571programming, from Graham Barr. See L<Net::FTP>, L<Net::NNTP>,
572L<Net::Ping>, L<Net::POP3>, L<Net::SMTP>, and L<Net::Time>.
573
574Perl installation leaves libnet unconfigured, use F<libnetcfg> to configure.
f39f21d8 575
576=item *
577
61947107 578C<List::Util> is a selection of general-utility list subroutines, like
bea4d472 579sum(), min(), first(), and shuffle(), by Graham Barr. See L<List::Util>.
f39f21d8 580
581=item *
582
61947107 583C<Locale::Constants>, C<Locale::Country>, C<Locale::Currency>, and
584C<Locale::Language>, from Neil Bowers, have been added. They provide the
585codes for various locale standards, such as "fr" for France, "usd" for
586US Dollar, and "jp" for Japanese.
f39f21d8 587
588 use Locale::Country;
589
590 $country = code2country('jp'); # $country gets 'Japan'
591 $code = country2code('Norway'); # $code gets 'no'
592
593See L<Locale::Constants>, L<Locale::Country>, L<Locale::Currency>,
61947107 594and L<Locale::Language>.
595
596=item *
597
598C<Locale::Maketext> is localization framework from Sean Burke. See
599L<Locale::Maketext>, and L<Locale::Maketext::TPJ13>. The latter is an
600article about software localization, originally published in The Perl
601Journal #13, republished here with kind permission.
602
603=item *
604
605C<Memoize> can make your functions faster by trading space for time,
606from Mark-Jason Dominus. See L<Memoize>.
f39f21d8 607
608=item *
609
61947107 610C<MIME::Base64> allows you to encode data in base64, from Gisle Aas,
611as defined in RFC 2045 - I<MIME (Multipurpose Internet Mail
612Extensions)>.
f39f21d8 613
614 use MIME::Base64;
615
616 $encoded = encode_base64('Aladdin:open sesame');
617 $decoded = decode_base64($encoded);
618
619 print $encoded, "\n"; # "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="
620
61947107 621See L<MIME::Base64>.
f39f21d8 622
623=item *
624
61947107 625C<MIME::QuotedPrint> allows you to encode data in quoted-printable
626encoding, as defined in RFC 2045 - I<MIME (Multipurpose Internet Mail
627Extensions)>, from Gisle Aas.
f39f21d8 628
629 use MIME::QuotedPrint;
630
631 $encoded = encode_qp("Smiley in Unicode: \x{263a}");
632 $decoded = decode_qp($encoded);
633
634 print $encoded, "\n"; # "Smiley in Unicode: =263A"
635
636MIME::QuotedPrint has been enhanced to provide the basic methods
637necessary to use it with PerlIO::Via as in :
638
639 use MIME::QuotedPrint;
057b7f2b 640 open($fh,">Via(MIME::QuotedPrint)",$path);
f39f21d8 641
61947107 642See L<MIME::QuotedPrint>.
f39f21d8 643
644=item *
645
61947107 646C<NEXT> is pseudo-class for method redispatch, from Damian Conway.
647See L<NEXT>.
f39f21d8 648
649=item *
650
1e13d81f 651C<open> is a new pragma for setting the default I/O disciplines
652for open().
653
654=item *
655
61947107 656C<PerlIO::Scalar> provides the implementation of IO to "in memory"
657Perl scalars as discussed above, from Nick Ing-Simmons. It also
658serves as an example of a loadable PerlIO layer. Other future
659possibilities include PerlIO::Array and PerlIO::Code.
660See L<PerlIO::Scalar>.
661
662=item *
663
664C<PerlIO::Via> acts as a PerlIO layer and wraps PerlIO layer
665functionality provided by a class (typically implemented in perl
666code), from Nick Ing-Simmons.
f39f21d8 667
668 use MIME::QuotedPrint;
057b7f2b 669 open($fh,">Via(MIME::QuotedPrint)",$path);
f39f21d8 670
671This will automatically convert everything output to C<$fh>
61947107 672to Quoted-Printable. See L<PerlIO::Via>.
f39f21d8 673
674=item *
675
1e13d81f 676C<Pod::ParseLink>, by Russ Allbery, has been added,
95f0a2f1 677to parse LZ<><> links in pods as described in the new
1e13d81f 678perlpodspec.
679
680=item *
681
61947107 682C<Pod::Text::Overstrike>, by Joe Smith, has been added.
f39f21d8 683It converts POD data to formatted overstrike text.
61947107 684See L<Pod::Text::Overstrike>.
f39f21d8 685
686=item *
687
61947107 688C<Scalar::Util> is a selection of general-utility scalar subroutines,
689like blessed(), reftype(), and tainted(). See L<Scalar::Util>.
690
691=item *
692
1e13d81f 693C<sort> is a new pragma for controlling the behaviour of sort().
694
695=item *
696
61947107 697C<Storable> gives persistence to Perl data structures by allowing the
698storage and retrieval of Perl data to and from files in a fast and
699compact binary format, from Raphael Manfredi. See L<Storable>.
700
701=item *
702
703C<Switch>, from Damian Conway, has been added. Just by saying
f39f21d8 704
705 use Switch;
706
707you have C<switch> and C<case> available in Perl.
708
709 use Switch;
710
711 switch ($val) {
712
713 case 1 { print "number 1" }
714 case "a" { print "string a" }
715 case [1..10,42] { print "number in list" }
716 case (@array) { print "number in list" }
717 case /\w+/ { print "pattern" }
718 case qr/\w+/ { print "pattern" }
719 case (%hash) { print "entry in hash" }
720 case (\%hash) { print "entry in hash" }
721 case (\&sub) { print "arg to subroutine" }
722 else { print "previous case not true" }
723 }
724
61947107 725See L<Switch>.
726
727=item *
728
729C<Test::More> is yet another framework for writing test scripts,
730more extensive than Test::Simple, by Michael Schwern. See L<Test::More>.
731
732=item *
733
aecce728 734C<Test::Simple> has basic utilities for writing tests, by Michael
61947107 735Schwern. See L<Test::Simple>.
77c8cf41 736
737=item *
738
61947107 739C<Text::Balanced> has been added, for extracting delimited text
740sequences from strings, from Damian Conway.
77c8cf41 741
742 use Text::Balanced 'extract_delimited';
743
744 ($a, $b) = extract_delimited("'never say never', he never said", "'", '');
745
746$a will be "'never say never'", $b will be ', he never said'.
747
748In addition to extract_delimited() there are also extract_bracketed(),
749extract_quotelike(), extract_codeblock(), extract_variable(),
750extract_tagged(), extract_multiple(), gen_delimited_pat(), and
751gen_extract_tagged(). With these you can implement rather advanced
61947107 752parsing algorithms. See L<Text::Balanced>.
77c8cf41 753
754=item *
755
c2e23569 756C<threads> is an interface to interpreter threads, by Arthur Bergman.
61947107 757Interpreter threads (ithreads) is the new thread model introduced in
c2e23569 758Perl 5.6 but only available as an internal interface for extension
759writers (and for Win32 Perl for C<fork()> emulation). See L<threads>.
77c8cf41 760
761=item *
762
61947107 763C<threads::shared> allows data sharing for interpreter threads, from
764Arthur Bergman. In the ithreads model any data sharing between
765threads must be explicit, as opposed to the old 5.005 thread model
766where data sharing was implicit. See L<threads::shared>.
77c8cf41 767
768=item *
769
61947107 770C<Tie::RefHash::Nestable>, by Edward Avis, allows storing hash
ba370e9b 771references (unlike the standard Tie::RefHash) The module is contained
772within Tie::RefHash, see L<Tie::RefHash>.
77c8cf41 773
774=item *
775
61947107 776C<Time::HiRes> provides high resolution timing (ualarm, usleep,
777and gettimeofday), from Douglas E. Wegscheid. See L<Time::HiRes>.
77c8cf41 778
779=item *
780
61947107 781C<Unicode::UCD> offers a querying interface to the Unicode Character
782Database. See L<Unicode::UCD>.
77c8cf41 783
784=item *
785
61947107 786C<Unicode::Collate> implements the UCA (Unicode Collation Algorithm)
787for sorting Unicode strings, by SADAHIRO Tomoyuki. See L<Unicode::Collate>.
77c8cf41 788
789=item *
790
61947107 791C<Unicode::Normalize> implements the various Unicode normalization
792forms, by SADAHIRO Tomoyuki. See L<Unicode::Normalize>.
77c8cf41 793
794=item *
795
61947107 796C<XS::Typemap>, by Tim Jenness, is a test extension that exercises XS
797typemaps. Nothing gets installed but for extension writers the code
798is worth studying.
77c8cf41 799
800=back
801
802=head2 Updated And Improved Modules and Pragmata
803
804=over 4
805
806=item *
807
61947107 808The following independently supported modules have been updated to the
809newest versions from CPAN: CGI, CPAN, DB_File, File::Spec, File::Temp,
810Getopt::Long, Math::BigFloat, Math::BigInt, the podlators bundle
811(Pod::Man, Pod::Text), Pod::LaTeX, Pod::Parser, Storable,
812Term::ANSIColor, Test, Text-Tabs+Wrap.
77c8cf41 813
814=item *
815
61947107 816The attributes::reftype() now works on tied arguments.
77c8cf41 817
818=item *
819
057b7f2b 820AutoLoader can now be disabled with C<no AutoLoader;>.
77c8cf41 821
822=item *
823
1e13d81f 824B::Deparse has been significantly enhanced. It now can deparse almost
825all of the standard test suite (so that the tests still succeed).
826There is a make target "test.deparse" for trying this out.
77c8cf41 827
828=item *
829
1e13d81f 830Class::Struct can now define the classes in compile time.
77c8cf41 831
832=item *
833
1e13d81f 834Class::Struct now assigns the array/hash element if the accessor
835is called with an array/hash element as the B<sole> argument.
77c8cf41 836
837=item *
838
1e13d81f 839Data::Dumper has now an option to sort hashes.
77c8cf41 840
841=item *
842
1e13d81f 843Data::Dumper has now an option to dump code references
844using B::Deparse.
77c8cf41 845
846=item *
847
44da0e71 848DB_File now supports newer Berkeley DB versions, among
849other improvements.
850
851=item *
852
1e13d81f 853The English module can now be used without the infamous performance
854hit by saying
77c8cf41 855
1e13d81f 856 use English '-no_performance_hit';
77c8cf41 857
1e13d81f 858(Assuming, of course, that one doesn't need the troublesome variables
859C<$`>, C<$&>, or C<$'>.) Also, introduced C<@LAST_MATCH_START> and
860C<@LAST_MATCH_END> English aliases for C<@-> and C<@+>.
77c8cf41 861
862=item *
863
1e13d81f 864Fcntl, Socket, and Sys::Syslog have been rewritten to use the
865new-style constant dispatch section (see L<ExtUtils::Constant>).
866This means that they will be more robust and hopefully faster.
77c8cf41 867
868=item *
869
44da0e71 870File::Find now chdir()s correctly when chasing symbolic links.
871
872=item *
873
1e13d81f 874File::Find now has pre- and post-processing callbacks. It also
875correctly changes directories when chasing symbolic links. Callbacks
876(naughtily) exiting with "next;" instead of "return;" now work.
61947107 877
878=item *
879
1e13d81f 880File::Find is now (again) reentrant. It also has been made
881more portable.
77c8cf41 882
61947107 883=item *
884
1e13d81f 885File::Glob::glob() renamed to File::Glob::bsd_glob() to avoid
886prototype mismatch with CORE::glob().
61947107 887
888=item *
889
890File::Glob now supports C<GLOB_LIMIT> constant to limit the size of
891the returned list of filenames.
77c8cf41 892
893=item *
894
895Devel::Peek now has an interface for the Perl memory statistics
896(this works only if you are using perl's malloc, and if you have
897compiled with debugging).
898
899=item *
900
1e13d81f 901IPC::Open3 now allows the use of numeric file descriptors.
902
903=item *
904
77c8cf41 905IO::Socket has now atmark() method, which returns true if the socket
906is positioned at the out-of-band mark. The method is also exportable
907as a sockatmark() function.
908
909=item *
910
911IO::Socket::INET has support for ReusePort option (if your platform
912supports it). The Reuse option now has an alias, ReuseAddr. For clarity
913you may want to prefer ReuseAddr.
914
915=item *
916
61947107 917IO::Socket::INET now supports C<LocalPort> of zero (usually meaning
918that the operating system will make one up.)
77c8cf41 919
920=item *
921
1e13d81f 922use lib now works identically to @INC. Removing directories
923with 'no lib' now works.
924
925=item *
926
927Math::BigFloat and Math::BigInt have undergone a full rewrite.
928They are now magnitudes faster, and they support various
61947107 929bignum libraries such as GMP and PARI as their backends.
f39f21d8 930
931=item *
932
44da0e71 933Math::Complex handles inf, NaN etc., better.
934
935=item *
936
61947107 937Net::Ping has been enhanced. There is now "external" protocol which
938uses Net::Ping::External module which runs external ping(1) and parses
44da0e71 939the output. A version of Net::Ping::External is available in CPAN.
f39f21d8 940
77c8cf41 941=item *
f39f21d8 942
da6838c8 943POSIX::sigaction() is now much more flexible and robust.
61947107 944You can now install coderef handlers, 'DEFAULT', and 'IGNORE'
945handlers, installing new handlers was not atomic.
f39f21d8 946
947=item *
948
da6838c8 949In Safe the C<%INC> now localised in a Safe compartment so that
76663d67 950use/require work.
951
952=item *
953
44da0e71 954In SDBM_File on dosish platforms, some keys went missing because of
955lack of support for files with "holes". A workaround for the problem
956has been added.
957
958=item *
959
da6838c8 960In Search::Dict one can now have a pre-processing hook for the
76663d67 961lines being searched.
1e13d81f 962
963=item *
964
965The Shell module now has an OO interface.
966
967=item *
968
61947107 969The Test module has been significantly enhanced.
f39f21d8 970
971=item *
972
da6838c8 973The vars pragma now supports declaring fully qualified variables.
77c8cf41 974(Something that C<our()> does not and will not support.)
f39f21d8 975
888aee59 976=item *
977
61947107 978The utf8:: name space (as in the pragma) provides various
979Perl-callable functions to provide low level access to Perl's
980internal Unicode representation. At the moment only length()
981has been implemented.
888aee59 982
f39f21d8 983=back
984
77c8cf41 985=head1 Utility Changes
f39f21d8 986
987=over 4
988
989=item *
990
61947107 991Emacs perl mode (emacs/cperl-mode.el) has been updated to version
77c8cf41 9924.31.
f39f21d8 993
994=item *
995
61947107 996F<emacs/e2ctags.pl> is now much faster.
f39f21d8 997
998=item *
999
1e13d81f 1000C<h2ph> now supports C trigraphs.
1001
1002=item *
1003
1004C<h2xs> now produces a template README.
f39f21d8 1005
77c8cf41 1006=item *
1007
1e13d81f 1008C<h2xs> now uses C<Devel::PPort> for better portability between
1009different versions of Perl.
f39f21d8 1010
1011=item *
1012
1e13d81f 1013C<h2xs> uses the new L<ExtUtils::Constant> module which will affect
61947107 1014newly created extensions that define constants. Since the new code is
1015more correct (if you have two constants where the first one is a
1016prefix of the second one, the first constant B<never> gets defined),
1017less lossy (it uses integers for integer constant, as opposed to the
1018old code that used floating point numbers even for integer constants),
1019and slightly faster, you might want to consider regenerating your
1020extension code (the new scheme makes regenerating easy).
1021L<h2xs> now also supports C trigraphs.
f39f21d8 1022
1023=item *
1024
1e13d81f 1025C<libnetcfg> has been added to configure the libnet.
f39f21d8 1026
1027=item *
1028
1e13d81f 1029C<perlbug> is now much more robust. It also sends the bug report to
61947107 1030perl.org, not perl.com.
f39f21d8 1031
1032=item *
1033
1e13d81f 1034C<perlcc> has been rewritten and its user interface (that is,
61947107 1035command line) is much more like that of the UNIX C compiler, cc.
44da0e71 1036(The perlbc tools has been removed. Use C<perlcc -B> instead.)
f39f21d8 1037
1038=item *
1039
aecce728 1040C<perlivp> is a new Installation Verification Procedure utility
1041for running any time after installing Perl.
f39f21d8 1042
1043=item *
1044
1e13d81f 1045C<pod2html> now allows specifying a cache directory.
f39f21d8 1046
1047=item *
1048
1e13d81f 1049C<s2p> has been completely rewritten in Perl. (It is in fact a full
1050implementation of sed in Perl: you can use the sed functionality by
1051using the C<psed> utility.)
61947107 1052
1053=item *
1054
1e13d81f 1055C<xsubpp> now understands POD documentation embedded in the *.xs files.
f39f21d8 1056
1057=item *
1058
1e13d81f 1059C<xsubpp> now supports OUT keyword.
f39f21d8 1060
1061=back
1062
77c8cf41 1063=head1 New Documentation
f39f21d8 1064
1065=over 4
1066
1067=item *
1068
77c8cf41 1069perl56delta details the changes between the 5.005 release and the
10705.6.0 release.
f39f21d8 1071
1072=item *
1073
61947107 1074perlclib documents the internal replacements for standard C library
1075functions. (Interesting only for extension writers and Perl core
1076hackers.)
1077
1078=item *
1079
77c8cf41 1080perldebtut is a Perl debugging tutorial.
f39f21d8 1081
77c8cf41 1082=item *
f39f21d8 1083
77c8cf41 1084perlebcdic contains considerations for running Perl on EBCDIC platforms.
f39f21d8 1085
77c8cf41 1086=item *
1087
888aee59 1088perlintro is a gentle introduction to Perl.
1089
1090=item *
1091
61947107 1092perliol documents the internals of PerlIO with layers.
1093
1094=item *
1095
888aee59 1096perlmodstyle is a style guide for writing modules.
1097
1098=item *
1099
77c8cf41 1100perlnewmod tells about writing and submitting a new module.
f39f21d8 1101
1102=item *
1103
34babc16 1104perlpacktut is a pack() tutorial.
1105
1106=item *
1107
888aee59 1108perlpod has been rewritten to be clearer and to record the best
1109practices gathered over the years.
1110
1111=item *
1112
057b7f2b 1113perlpodspec is a more formal specification of the pod format,
888aee59 1114mainly of interest for writers of pod applications, not to
1115people writing in pod.
1116
1117=item *
1118
77c8cf41 1119perlretut is a regular expression tutorial.
f39f21d8 1120
1121=item *
1122
77c8cf41 1123perlrequick is a regular expressions quick-start guide.
1124Yes, much quicker than perlretut.
f39f21d8 1125
77c8cf41 1126=item *
f39f21d8 1127
61947107 1128perltodo has been updated.
1129
1130=item *
1131
888aee59 1132perltootc has been renamed as perltooc (to not to conflict
61947107 1133with perltoot in filesystems restricted to "8.3" names)
888aee59 1134
1135=item *
1136
1137perluniintro is an introduction to using Unicode in Perl
1138(perlunicode is more of a reference)
1139
1140=item *
1141
77c8cf41 1142perlutil explains the command line utilities packaged with the Perl
1143distribution.
1144
1145=back
f39f21d8 1146
61947107 1147The following platform-specific documents are available before
1148the installation as README.I<platform>, and after the installation
1149as perlI<platform>:
f39f21d8 1150
61947107 1151 perlaix perlamiga perlapollo perlbeos perlbs2000
1152 perlce perlcygwin perldgux perldos perlepoc perlhpux
1153 perlhurd perlmachten perlmacos perlmint perlmpeix
1154 perlnetware perlos2 perlos390 perlplan9 perlqnx perlsolaris
1155 perltru64 perluts perlvmesa perlvms perlvos perlwin32
77c8cf41 1156
1157=over 4
1158
1159=item *
1160
61947107 1161The documentation for the POSIX-BC platform is called "BS2000", to avoid
1162confusion with the Perl POSIX module.
77c8cf41 1163
1164=item *
1165
61947107 1166The documentation for the WinCE platform is called "CE", to avoid
1167confusion with the perlwin32 documentation on 8.3-restricted filesystems.
77c8cf41 1168
1169=back
1170
1171=head1 Performance Enhancements
1172
1173=over 4
1174
1175=item *
1176
44da0e71 1177map() could get pathologically slow when the result list it generates
1178is larger than the source list. The performance has been improved for
1179common scenarios.
77c8cf41 1180
1181=item *
1182
e1f170bd 1183sort() has been changed to use primarily mergesort internally as
1184opposed to the earlier quicksort. For very small lists this may
1185result in slightly slower sorting times, but in general the speedup
1186should be at least 20%. Additional bonuses are that the worst case
1187behaviour of sort() is now better (in computer science terms it now
1188runs in time O(N log N), as opposed to quicksort's Theta(N**2)
1189worst-case run time behaviour), and that sort() is now stable
1190(meaning that elements with identical keys will stay ordered as they
1191were before the sort). See the C<sort> pragma for information.
77c8cf41 1192
05e25c75 1193The story in more detail: suppose you want to serve yourself a little
1194slice of Pi.
1195
1196 @digits = ( 3,1,4,1,5,9 );
1197
1198A numerical sort of the digits will yield (1,1,3,4,5,9), as expected.
1199Which C<1> comes first is hard to know, since one C<1> looks pretty
1200much like any other. You can regard this as totally trivial,
1201or somewhat profound. However, if you just want to sort the even
1202digits ahead of the odd ones, then what will
1203
1204 sort { ($a % 2) <=> ($b % 2) } @digits;
1205
1206yield? The only even digit, C<4>, will come first. But how about
1207the odd numbers, which all compare equal? With the quicksort algorithm
1208used to implement Perl 5.6 and earlier, the order of ties is left up
1209to the sort. So, as you add more and more digits of Pi, the order
1210in which the sorted even and odd digits appear will change.
1211and, for sufficiently large slices of Pi, the quicksort algorithm
1212in Perl 5.8 won't return the same results even if reinvoked with the
1213same input. The justification for this rests with quicksort's
1214worst case behavior. If you run
1215
1216 sort { $a <=> $b } ( 1 .. $N , 1 .. $N );
1217
1218(something you might approximate if you wanted to merge two sorted
1219arrays using sort), doubling $N doesn't just double the quicksort time,
1220it I<quadruples> it. Quicksort has a worst case run time that can
1221grow like N**2, so-called I<quadratic> behaviour, and it can happen
1222on patterns that may well arise in normal use. You won't notice this
1223for small arrays, but you I<will> notice it with larger arrays,
1224and you may not live long enough for the sort to complete on arrays
1225of a million elements. So the 5.8 quicksort scrambles large arrays
1226before sorting them, as a statistical defence against quadratic behaviour.
1227But that means if you sort the same large array twice, ties may be
1228broken in different ways.
1229
1230Because of the unpredictability of tie-breaking order, and the quadratic
1231worst-case behaviour, quicksort was I<almost> replaced completely with
1232a stable mergesort. I<Stable> means that ties are broken to preserve
1233the original order of appearance in the input array. So
1234
1235 sort { ($a % 2) <=> ($b % 2) } (3,1,4,1,5,9);
1236
1237will yield (4,3,1,1,5,9), guaranteed. The even and odd numbers
1238appear in the output in the same order they appeared in the input.
1239Mergesort has worst case O(NlogN) behaviour, the best value
1240attainable. And, ironically, this mergesort does particularly
1241well where quicksort goes quadratic: mergesort sorts (1..$N, 1..$N)
1242in O(N) time. But quicksort was rescued at the last moment because
1243it is faster than mergesort on certain inputs and platforms.
1244For example, if you really I<don't> care about the order of even
1245and odd digits, quicksort will run in O(N) time; it's very good
1246at sorting many repetitions of a small number of distinct elements.
1247The quicksort divide and conquer strategy works well on platforms
1248with relatively small, very fast, caches. Eventually, the problem gets
1249whittled down to one that fits in the cache, from which point it
1250benefits from the increased memory speed.
1251
1252Quicksort was rescued by implementing a sort pragma to control aspects
1253of the sort. The B<stable> subpragma forces stable behaviour,
1254regardless of algorithm. The B<_quicksort> and B<_mergesort>
1255subpragmas are heavy-handed ways to select the underlying implementation.
1256The leading C<_> is a reminder that these subpragmas may not survive
1257beyond 5.8. More appropriate mechanisms for selecting the implementation
1258exist, but they wouldn't have arrived in time to save quicksort.
1259
77c8cf41 1260=item *
1261
1262Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm
1263(http://burtleburtle.net/bob/hash/doobs.html). This algorithm is
1264reasonably fast while producing a much better spread of values than
1265the old hashing algorithm (originally by Chris Torek, later tweaked by
1266Ilya Zakharevich). Hash values output from the algorithm on a hash of
1267all 3-char printable ASCII keys comes much closer to passing the
1268DIEHARD random number generation tests. According to perlbench, this
1269change has not affected the overall speed of Perl.
1270
1271=item *
1272
1273unshift() should now be noticeably faster.
1274
1275=back
1276
1277=head1 Installation and Configuration Improvements
1278
1279=head2 Generic Improvements
1280
1281=over 4
1282
1283=item *
1284
1285INSTALL now explains how you can configure Perl to use 64-bit
1286integers even on non-64-bit platforms.
1287
1288=item *
1289
1290Policy.sh policy change: if you are reusing a Policy.sh file
1291(see INSTALL) and you use Configure -Dprefix=/foo/bar and in the old
1292Policy $prefix eq $siteprefix and $prefix eq $vendorprefix, all of
1293them will now be changed to the new prefix, /foo/bar. (Previously
1294only $prefix changed.) If you do not like this new behaviour,
1295specify prefix, siteprefix, and vendorprefix explicitly.
1296
1297=item *
1298
1299A new optional location for Perl libraries, otherlibdirs, is available.
1300It can be used for example for vendor add-ons without disturbing Perl's
1301own library directories.
1302
1303=item *
1304
1305In many platforms the vendor-supplied 'cc' is too stripped-down to
1306build Perl (basically, 'cc' doesn't do ANSI C). If this seems
1307to be the case and 'cc' does not seem to be the GNU C compiler
1308'gcc', an automatic attempt is made to find and use 'gcc' instead.
1309
1310=item *
1311
1312gcc needs to closely track the operating system release to avoid
1313build problems. If Configure finds that gcc was built for a different
1314operating system release than is running, it now gives a clearly visible
1315warning that there may be trouble ahead.
1316
1317=item *
1318
1319If binary compatibility with the 5.005 release is not wanted, Configure
1320no longer suggests including the 5.005 modules in @INC.
1321
1322=item *
1323
1324Configure C<-S> can now run non-interactively.
1325
1326=item *
1327
44da0e71 1328Configure support for pdp11-style memory models has been removed due
1329to obsolescence.
1330
1331=item *
1332
77c8cf41 1333configure.gnu now works with options with whitespace in them.
f39f21d8 1334
77c8cf41 1335=item *
f39f21d8 1336
77c8cf41 1337installperl now outputs everything to STDERR.
f39f21d8 1338
77c8cf41 1339=item *
1340
1341$Config{byteorder} is now computed dynamically (this is more robust
1342with "fat binaries" where an executable image contains binaries for
1343more than one binary platform.)
f39f21d8 1344
1345=item *
1346
1347Because PerlIO is now the default on most platforms, "-perlio" doesn't
1348get appended to the $Config{archname} (also known as $^O) anymore.
1349Instead, if you explicitly choose not to use perlio (Configure command
1350line option -Uuseperlio), you will get "-stdio" appended.
1351
1352=item *
1353
1354Another change related to the architecture name is that "-64all"
1355(-Duse64bitall, or "maximally 64-bit") is appended only if your
1356pointers are 64 bits wide. (To be exact, the use64bitall is ignored.)
1357
1358=item *
1359
77c8cf41 1360In AFS installations one can configure the root of the AFS to be
1361somewhere else than the default F</afs> by using the Configure
1362parameter C<-Dafsroot=/some/where/else>.
1363
1364=item *
1365
61947107 1366APPLLIB_EXP, a less-know configuration-time definition, has been
1367documented. It can be used to prepend site-specific directories
1368to Perl's default search path (@INC), see INSTALL for information.
1369
1370=item *
1371
77c8cf41 1372The version of Berkeley DB used when the Perl (and, presumably, the
1373DB_File extension) was built is now available as
1374C<@Config{qw(db_version_major db_version_minor db_version_patch)}>
1375from Perl and as C<DB_VERSION_MAJOR_CFG DB_VERSION_MINOR_CFG
1376DB_VERSION_PATCH_CFG> from C.
1377
1378=item *
1379
61947107 1380Building Berkeley DB3 for compatibility modes for DB, NDBM, and ODBM
1381has been documented in INSTALL.
77c8cf41 1382
1383=item *
1384
61947107 1385If you have CPAN access (either network or a local copy such as a
1386CD-ROM) you can during specify extra modules to Configure to build and
1387install with Perl using the -Dextras=... option. See INSTALL for
1388more details.
f39f21d8 1389
61947107 1390=item *
f39f21d8 1391
61947107 1392In addition to config.over a new override file, config.arch, is
1393available. That is supposed to be used by hints file writers for
1394architecture-wide changes (as opposed to config.over which is for
1395site-wide changes).
f39f21d8 1396
1397=item *
1398
e1f170bd 1399If your file system supports symbolic links you can build Perl outside
1400of the source directory by
1401
1402 mkdir /tmp/perl/build/directory
1403 cd /tmp/perl/build/directory
1404 sh /path/to/perl/source/Configure -Dmksymlinks ...
1405
1406This will create in /tmp/perl/build/directory a tree of symbolic links
1407pointing to files in /path/to/perl/source. The original files are left
1408unaffected. After Configure has finished you can just say
1409
1410 make all test
1411
1412and Perl will be built and tested, all in /tmp/perl/build/directory.
1413
1414=item *
1415
61947107 1416For Perl developers several new make targets for profiling
1417and debugging have been added, see L<perlhack>.
1418
1419=over 8
f39f21d8 1420
1421=item *
1422
61947107 1423Use of the F<gprof> tool to profile Perl has been documented in
1424L<perlhack>. There is a make target called "perl.gprof" for
1425generating a gprofiled Perl executable.
f39f21d8 1426
1427=item *
1428
61947107 1429If you have GCC 3, there is a make target called "perl.gcov" for
1430creating a gcoved Perl executable for coverage analysis. See
1431L<perlhack>.
f39f21d8 1432
1433=item *
1434
61947107 1435If you are on IRIX or Tru64 platforms, new profiling/debugging options
1436have been added, see L<perlhack> for more information about pixie and
1437Third Degree.
1438
1439=back
f39f21d8 1440
1441=item *
1442
61947107 1443Guidelines of how to construct minimal Perl installations have
1444been added to INSTALL.
f39f21d8 1445
1446=item *
1447
61947107 1448The Thread extension is now not built at all under ithreads
1449(C<Configure -Duseithreads>) because it wouldn't work anyway (the
1450Thread extension requires being Configured with C<-Duse5005threads>).
f39f21d8 1451
61947107 1452But note that the Thread.pm interface is now shared by both
1453thread models.
f39f21d8 1454
61947107 1455=back
f39f21d8 1456
61947107 1457=head2 New Or Improved Platforms
f39f21d8 1458
61947107 1459For the list of platforms known to support Perl,
1460see L<perlport/"Supported Platforms">.
1461
1462=over 4
f39f21d8 1463
1464=item *
1465
61947107 1466AIX dynamic loading should be now better supported.
f39f21d8 1467
f39f21d8 1468=item *
1469
77c8cf41 1470AIX should now work better with gcc, threads, and 64-bitness. Also the
1471long doubles support in AIX should be better now. See L<perlaix>.
f39f21d8 1472
1473=item *
1474
61947107 1475After a long pause, AmigaOS has been verified to be happy with Perl.
1476
1477=item *
1478
77c8cf41 1479AtheOS (http://www.atheos.cx/) is a new platform.
f39f21d8 1480
77c8cf41 1481=item *
f39f21d8 1482
77c8cf41 1483DG/UX platform now supports the 5.005-style threads. See L<perldgux>.
f39f21d8 1484
1485=item *
1486
77c8cf41 1487DYNIX/ptx platform (a.k.a. dynixptx) is supported at or near osvers 4.5.2.
f39f21d8 1488
1489=item *
1490
61947107 1491EBCDIC platforms (z/OS, also known as OS/390, POSIX-BC, and VM/ESA)
1492have been regained. Many test suite tests still fail and the
1493co-existence of Unicode and EBCDIC isn't quite settled, but the
1494situation is much better than with Perl 5.6. See L<perlos390>,
1495L<perlbs2000> (for POSIX-BC), and L<perlvmesa> for more information.
f39f21d8 1496
1497=item *
1498
61947107 1499Building perl with -Duseithreads or -Duse5005threads now works under
1500HP-UX 10.20 (previously it only worked under 10.30 or later). You will
1501need a thread library package installed. See README.hpux.
f39f21d8 1502
77c8cf41 1503=item *
f39f21d8 1504
61947107 1505MacOS Classic (MacPerl has of course been available since
1506perl 5.004 but now the source code bases of standard Perl
1507and MacPerl have been synchronised)
f39f21d8 1508
77c8cf41 1509=item *
f39f21d8 1510
61947107 1511MacOS X (or Darwin) should now be able to build Perl even on HFS+
1512filesystems. (The case-insensitivity confused the Perl build process.)
f39f21d8 1513
888aee59 1514=item *
1515
61947107 1516NCR MP-RAS is now supported.
888aee59 1517
1518=item *
1519
61947107 1520NetWare from Novell is now supported. See L<perlnetware>.
888aee59 1521
1522=item *
1523
61947107 1524NonStop-UX is now supported.
888aee59 1525
1526=item *
1527
44da0e71 1528NEC SUPER-UX is now supported.
1529
1530=item *
1531
61947107 1532Amdahl UTS UNIX mainframe platform is now supported.
888aee59 1533
1534=item *
1535
61947107 1536WinCE is now supported. See L<perlce>.
1537
1538=item *
1539
1540z/OS (formerly known as OS/390, formerly known as MVS OE) has now
1541support for dynamic loading. This is not selected by default,
1542however, you must specify -Dusedl in the arguments of Configure.
888aee59 1543
f39f21d8 1544=back
1545
1546=head1 Selected Bug Fixes
1547
e1f170bd 1548Numerous memory leaks and uninitialized memory accesses have been
1549hunted down. Most importantly anonymous subs used to leak quite
1550a bit.
ba370e9b 1551
f39f21d8 1552=over 4
1553
1554=item *
1555
e1f170bd 1556The autouse pragma didn't work for Multi::Part::Function::Names.
f39f21d8 1557
1558=item *
1559
44da0e71 1560caller() could cause core dumps in certain situations. Carp was sometimes
1561affected by this problem.
1562
1563=item *
1564
e1f170bd 1565chop(@list) in list context returned the characters chopped in
1566reverse order. This has been reversed to be in the right order.
f39f21d8 1567
1568=item *
1569
e1f170bd 1570Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm)
1571when building the Perl binary. The only exception to this is SunOS 4.x,
1572which needs them.
f39f21d8 1573
1574=item *
1575
e1f170bd 1576The behaviour of non-decimal but numeric string constants such as
1577"0x23" was platform-dependent: in some platforms that was seen as 35,
1578in some as 0, in some as a floating point number (don't ask). This
1579was caused by Perl using the operating system libraries in a situation
1580where the result of the string to number conversion is undefined: now
1581Perl consistently handles such strings as zero in numeric contexts.
f39f21d8 1582
1583=item *
1584
e1f170bd 1585The order of DESTROYs has been made more predictable.
f39f21d8 1586
1587=item *
1588
e1f170bd 1589Several debugger fixes: exit code now reflects the script exit code,
1590condition C<"0"> now treated correctly, the C<d> command now checks
44da0e71 1591line number, the C<$.> no longer gets corrupted, all debugger output
1592now goes correctly to the socket if RemotePort is set.
1593
1594=item *
1595
1596Perl 5.6.0 could emit spurious warnings about redefinition of dl_error()
1597when statically building extensions into perl. This has been corrected.
f39f21d8 1598
1599=item *
1600
e1f170bd 1601L<dprofpp> -R didn't work.
f39f21d8 1602
1603=item *
1604
e1f170bd 1605C<*foo{FORMAT}> now works.
44da0e71 1606=item *
1607
1608Infinity is now recognized as a number.
f39f21d8 1609
1610=item *
1611
e1f170bd 1612UNIVERSAL::isa no longer caches methods incorrectly. (This broke
1613the Tk extension with 5.6.0.)
f39f21d8 1614
1615=item *
1616
e1f170bd 1617Lexicals I: lexicals outside an eval "" weren't resolved
1618correctly inside a subroutine definition inside the eval "" if they
1619were not already referenced in the top level of the eval""ed code.
f39f21d8 1620
1621=item *
1622
e1f170bd 1623Lexicals II: lexicals leaked at file scope into subroutines that
1624were declared before the lexicals.
f39f21d8 1625
1626=item *
1627
44da0e71 1628Lexical warnings now propagating correctly between scopes
1629and into C<eval "...">.
1630
1631=item *
1632
1633C<use warnings qw(FATAL all)> did not work as intended. This has been
1634corrected.
1635
1636=item *
1637
1638warnings::enabled() now reports the state of $^W correctly if the caller
1639isn't using lexical warnings.
f39f21d8 1640
1641=item *
1642
e1f170bd 1643Line renumbering with eval and C<#line> now works.
f39f21d8 1644
1645=item *
1646
e1f170bd 1647Fixed numerous memory leaks, especially in eval "".
f39f21d8 1648
1649=item *
1650
e1f170bd 1651mkdir() now ignores trailing slashes in the directory name,
1652as mandated by POSIX.
f39f21d8 1653
1654=item *
1655
e1f170bd 1656Some versions of glibc have a broken modfl(). This affects builds
1657with C<-Duselongdouble>. This version of Perl detects this brokenness
1658and has a workaround for it. The glibc release 2.2.2 is known to have
1659fixed the modfl() bug.
f39f21d8 1660
1661=item *
1662
e1f170bd 1663Modulus of unsigned numbers now works (4063328477 % 65535 used to
1664return 27406, instead of 27047).
f39f21d8 1665
1666=item *
1667
e1f170bd 1668Some "not a number" warnings introduced in 5.6.0 eliminated to be
1669more compatible with 5.005. Infinity is now recognised as a number.
f39f21d8 1670
77c8cf41 1671=item *
f39f21d8 1672
44da0e71 1673Numeric conversions did not recognize changes in the string value
1674properly in certain circumstances.
1675
1676=item *
1677
e1f170bd 1678Attributes (like :shared) didn't work with our().
f39f21d8 1679
1680=item *
1681
e1f170bd 1682our() variables will not cause "will not stay shared" warnings.
f39f21d8 1683
1684=item *
1685
44da0e71 1686"our" variables of the same name declared in two sibling blocks
1687resulted in bogus warnings about "redeclaration" of the variables.
1688The problem has been corrected.
1689
1690=item *
1691
e1f170bd 1692pack "Z" now correctly terminates the string with "\0".
f39f21d8 1693
1694=item *
1695
e1f170bd 1696Fix password routines which in some shadow password platforms
1697(e.g. HP-UX) caused getpwent() to return every other entry.
f39f21d8 1698
77c8cf41 1699=item *
f39f21d8 1700
e1f170bd 1701The PERL5OPT environment variable (for passing command line arguments
1702to Perl) didn't work for more than a single group of options.
f39f21d8 1703
77c8cf41 1704=item *
f39f21d8 1705
e1f170bd 1706PERL5OPT with embedded spaces didn't work.
f39f21d8 1707
77c8cf41 1708=item *
f39f21d8 1709
e1f170bd 1710printf() no longer resets the numeric locale to "C".
f39f21d8 1711
77c8cf41 1712=item *
f39f21d8 1713
44da0e71 1714C<qw(a\\b)> now parses correctly as C<'a\\b'>.
1715
1716=item *
1717
1718pos() did not return the correct value within s///ge in earlier
1719versions. This is now handled correctly.
f39f21d8 1720
77c8cf41 1721=item *
f39f21d8 1722
e1f170bd 1723Printing quads (64-bit integers) with printf/sprintf now works
1724without the q L ll prefixes (assuming you are on a quad-capable platform).
f39f21d8 1725
77c8cf41 1726=item *
f39f21d8 1727
e1f170bd 1728Regular expressions on references and overloaded scalars now work.
f39f21d8 1729
ba370e9b 1730=item *
1731
e1f170bd 1732Right-hand side magic (GMAGIC) could in many cases such as string
1733concatenation be invoked too many times.
ba370e9b 1734
1735=item *
1736
e1f170bd 1737scalar() now forces scalar context even when used in void context.
ba370e9b 1738
1739=item *
1740
e1f170bd 1741SOCKS support is now much more robust.
ba370e9b 1742
1743=item *
1744
e1f170bd 1745sort() arguments are now compiled in the right wantarray context
1746(they were accidentally using the context of the sort() itself).
44da0e71 1747The comparison block is now run in scalar context, and the arguments
1748to be sorted are always provided list context.
ba370e9b 1749
1750=item *
1751
e1f170bd 1752Changed the POSIX character class C<[[:space:]]> to include the (very
c2e23569 1753rarely used) vertical tab character. Added a new POSIX-ish character
1754class C<[[:blank:]]> which stands for horizontal whitespace
1755(currently, the space and the tab).
ba370e9b 1756
1757=item *
1758
1759The tainting behaviour of sprintf() has been rationalized. It does
1760not taint the result of floating point formats anymore, making the
1761behaviour consistent with that of string interpolation.
1762
1763=item *
1764
44da0e71 1765Some cases of inconsistent taint propagation (such as within hash
1766values) have been fixed.
1767
1768=item *
1769
1770The RE engine found in Perl 5.6.0 accidentally pessimised certain kinds
1771of simple pattern matches. These are now handled better.
1772
1773=item *
1774
1775Regular expression debug output (whether through C<use re 'debug'>
1776or via C<-Dr>) now looks better.
1777
1778=item *
1779
1780Multi-line matches like C<"a\nxb\n" =~ /(?!\A)x/m> were flawed. The
1781bug has been fixed.
1782
1783=item *
1784
1785Use of $& could trigger a core dump under some situations. This
1786is now avoided.
1787
1788=item *
1789
c2e23569 1790The regular expression captured submatches ($1, $2, ...) are now
1791more consistently unset if the match fails, instead of leaving false
1792data lying around in them.
1793
1794=item *
1795
44da0e71 1796readline() on files opened in "slurp" mode could return an extra "" at
1797the end in certain situations. This has been corrected.
1798
1799=item *
1800
1801Autovivification of symbolic references of special variables described
1802in L<perlvar> (as in C<${$num}>) was accidentally disabled. This works
1803again now.
1804
1805=item *
1806
da6838c8 1807Sys::Syslog ignored the C<LOG_AUTH> constant.
ba370e9b 1808
1809=item *
1810
e1f170bd 1811All but the first argument of the IO syswrite() method are now optional.
ba370e9b 1812
1813=item *
1814
e1f170bd 1815$AUTOLOAD, sort(), lock(), and spawning subprocesses
1816in multiple threads simultaneously are now thread-safe.
ba370e9b 1817
1818=item *
1819
e1f170bd 1820Tie::ARRAY SPLICE method was broken.
ba370e9b 1821
1822=item *
1823
e1f170bd 1824Allow read-only string on left hand side of non-modifying tr///.
ba370e9b 1825
1826=item *
1827
e1f170bd 1828Several Unicode fixes.
ba370e9b 1829
1830=over 8
1831
1832=item *
1833
e1f170bd 1834BOMs (byte order marks) in the beginning of Perl files
1835(scripts, modules) should now be transparently skipped.
1836UTF-16 (UCS-2) encoded Perl files should now be read correctly.
ba370e9b 1837
1838=item *
1839
e1f170bd 1840The character tables have been updated to Unicode 3.1.1.
ba370e9b 1841
1842=item *
1843
e1f170bd 1844Comparing with utf8 data does not magically upgrade non-utf8 data
1845into utf8.
ba370e9b 1846
1847=item *
1848
e1f170bd 1849C<IsAlnum>, C<IsAlpha>, and C<IsWord> now match titlecase.
f39f21d8 1850
77c8cf41 1851=item *
f39f21d8 1852
e1f170bd 1853Concatenation with the C<.> operator or via variable interpolation,
1854C<eq>, C<substr>, C<reverse>, C<quotemeta>, the C<x> operator,
1855substitution with C<s///>, single-quoted UTF8, should now work.
f39f21d8 1856
77c8cf41 1857=item *
f39f21d8 1858
e1f170bd 1859The C<tr///> operator now works. Note that the C<tr///CU>
1860functionality has been removed (but see pack('U0', ...)).
f39f21d8 1861
77c8cf41 1862=item *
f39f21d8 1863
e1f170bd 1864C<eval "v200"> now works.
f39f21d8 1865
77c8cf41 1866=item *
f39f21d8 1867
44da0e71 1868Perl 5.6.0 parsed m/\x{ab}/ incorrectly, leading to spurious warnings.
1869This has been corrected.
1870
1871=item *
1872
e1f170bd 1873Zero entries were missing from the Unicode classes like C<IsDigit>.
f39f21d8 1874
e1f170bd 1875=back
f39f21d8 1876
44da0e71 1877=item *
1878
1879Large unsigned numbers (those above 2**31) could sometimes lose their
1880unsignedness, causing bogus results in arithmetic operations.
1881
77c8cf41 1882=back
f39f21d8 1883
77c8cf41 1884=head2 Platform Specific Changes and Fixes
f39f21d8 1885
1886=over 4
1887
1888=item *
1889
77c8cf41 1890BSDI 4.*
f39f21d8 1891
77c8cf41 1892Perl now works on post-4.0 BSD/OSes.
f39f21d8 1893
1894=item *
1895
77c8cf41 1896All BSDs
f39f21d8 1897
057b7f2b 1898Setting C<$0> now works (as much as possible; see L<perlvar> for details).
f39f21d8 1899
1900=item *
1901
77c8cf41 1902Cygwin
f39f21d8 1903
77c8cf41 1904Numerous updates; currently synchronised with Cygwin 1.1.4.
f39f21d8 1905
1906=item *
1907
e1f170bd 1908Previously DYNIX/ptx had problems in its Configure probe for non-blocking I/O.
1909
1910=item *
1911
77c8cf41 1912EPOC
f39f21d8 1913
77c8cf41 1914EPOC update after Perl 5.6.0. See README.epoc.
f39f21d8 1915
1916=item *
1917
77c8cf41 1918FreeBSD 3.*
f39f21d8 1919
77c8cf41 1920Perl now works on post-3.0 FreeBSDs.
f39f21d8 1921
1922=item *
1923
77c8cf41 1924HP-UX
1925
1926README.hpux updated; C<Configure -Duse64bitall> now almost works.
f39f21d8 1927
1928=item *
1929
77c8cf41 1930IRIX
f39f21d8 1931
77c8cf41 1932Numerous compilation flag and hint enhancements; accidental mixing
1933of 32-bit and 64-bit libraries (a doomed attempt) made much harder.
f39f21d8 1934
77c8cf41 1935=item *
f39f21d8 1936
77c8cf41 1937Linux
f39f21d8 1938
e1f170bd 1939=over 8
1940
1941=item *
1942
77c8cf41 1943Long doubles should now work (see INSTALL).
f39f21d8 1944
1945=item *
1946
e1f170bd 1947Linux previously had problems related to sockaddrlen when using
1948accept(), revcfrom() (in Perl: recv()), getpeername(), and getsockname().
1949
1950=back
1951
1952=item *
1953
77c8cf41 1954MacOS Classic
f39f21d8 1955
77c8cf41 1956Compilation of the standard Perl distribution in MacOS Classic should
1957now work if you have the Metrowerks development environment and
1958the missing Mac-specific toolkit bits. Contact the macperl mailing
1959list for details.
f39f21d8 1960
1961=item *
1962
77c8cf41 1963MPE/iX
f39f21d8 1964
77c8cf41 1965MPE/iX update after Perl 5.6.0. See README.mpeix.
f39f21d8 1966
1967=item *
1968
77c8cf41 1969NetBSD/sparc
f39f21d8 1970
77c8cf41 1971Perl now works on NetBSD/sparc.
f39f21d8 1972
1973=item *
1974
77c8cf41 1975OS/2
f39f21d8 1976
77c8cf41 1977Now works with usethreads (see INSTALL).
f39f21d8 1978
1979=item *
1980
77c8cf41 1981Solaris
f39f21d8 1982
77c8cf41 198364-bitness using the Sun Workshop compiler now works.
f39f21d8 1984
1985=item *
1986
77c8cf41 1987Tru64 (aka Digital UNIX, aka DEC OSF/1)
f39f21d8 1988
77c8cf41 1989The operating system version letter now recorded in $Config{osvers}.
1990Allow compiling with gcc (previously explicitly forbidden). Compiling
1991with gcc still not recommended because buggy code results, even with
1992gcc 2.95.2.
f39f21d8 1993
1994=item *
1995
77c8cf41 1996Unicos
1997
1998Fixed various alignment problems that lead into core dumps either
1999during build or later; no longer dies on math errors at runtime;
2000now using full quad integers (64 bits), previously was using
2001only 46 bit integers for speed.
f39f21d8 2002
2003=item *
2004
77c8cf41 2005VMS
2006
2007chdir() now works better despite a CRT bug; now works with MULTIPLICITY
2008(see INSTALL); now works with Perl's malloc.
f39f21d8 2009
00bb525a 2010The tainting of C<%ENV> elements via C<keys> or C<values> was previously
2011unimplemented. It now works as documented.
2012
2013The C<waitpid> emulation has been improved. The worst bug (now fixed)
2014was that a pid of -1 would cause a wildcard search of all processes on
2015the system. The most significant enhancement is that we can now
2016usually get the completion status of a terminated process.
2017
2018POSIX-style signals are now emulated much better on VMS versions prior
2019to 7.0.
2020
2021The C<system> function and backticks operator have improved
2022functionality and better error handling.
2023
f39f21d8 2024=item *
2025
77c8cf41 2026Windows
f39f21d8 2027
77c8cf41 2028=over 8
f39f21d8 2029
2030=item *
2031
77c8cf41 2032accept() no longer leaks memory.
f39f21d8 2033
2034=item *
2035
e1f170bd 2036Borland C++ v5.5 is now a supported compiler that can build Perl.
2037However, the generated binaries continue to be incompatible with those
2038generated by the other supported compilers (GCC and Visual C++).
2039
2040=item *
2041
77c8cf41 2042Better chdir() return value for a non-existent directory.
f39f21d8 2043
77c8cf41 2044=item *
f39f21d8 2045
e1f170bd 2046Duping socket handles with open(F, ">&MYSOCK") now works under Windows 9x.
2047
2048=item *
2049
77c8cf41 2050New %ENV entries now propagate to subprocesses.
f39f21d8 2051
2052=item *
2053
44da0e71 2054Current directory entries in %ENV are now correctly propagated to child
2055processes.
2056
2057=item *
2058
77c8cf41 2059$ENV{LIB} now used to search for libs under Visual C.
2060
2061=item *
2062
44da0e71 2063fork() emulation has been improved in various ways, but still continues
2064to be experimental. See L<perlfork> for known bugs and caveats.
e1f170bd 2065
2066=item *
2067
77c8cf41 2068A failed (pseudo)fork now returns undef and sets errno to EAGAIN.
f39f21d8 2069
2070=item *
2071
44da0e71 2072Win32::GetCwd() correctly returns C:\ instead of C: when at the drive root.
2073Other bugs in chdir() and Cwd::cwd() have also been fixed.
2074
2075=item *
2076
e1f170bd 2077HTML files will be installed in c:\perl\html instead of c:\perl\lib\pod\html
2078
2079=item *
2080
2081The makefiles now provide a single switch to bulk-enable all the features
2082enabled in ActiveState ActivePerl (a popular Win32 binary distribution).
2083
2084=item *
2085
77c8cf41 2086Allow REG_EXPAND_SZ keys in the registry.
f39f21d8 2087
2088=item *
2089
77c8cf41 2090Can now send() from all threads, not just the first one.
f39f21d8 2091
2092=item *
2093
77c8cf41 2094Fake signal handling reenabled, bugs and all.
f39f21d8 2095
2096=item *
2097
44da0e71 2098%SIG has been enabled under USE_ITHREADS, but its use is completely
2099unsupported under all configurations.
2100
2101=item *
2102
77c8cf41 2103Less stack reserved per thread so that more threads can run
2104concurrently. (Still 16M per thread.)
f39f21d8 2105
2106=item *
2107
c2e23569 2108C<File::Spec-&gt;tmpdir()> now prefers C:/temp over /tmp
77c8cf41 2109(works better when perl is running as service).
f39f21d8 2110
2111=item *
2112
77c8cf41 2113Better UNC path handling under ithreads.
f39f21d8 2114
2115=item *
2116
44da0e71 2117wait(), waitpid() and backticks now return the correct exit status under
2118Windows 9x.
f39f21d8 2119
2120=item *
2121
77c8cf41 2122winsock handle leak fixed.
f39f21d8 2123
2124=back
2125
77c8cf41 2126=back
f39f21d8 2127
77c8cf41 2128=head1 New or Changed Diagnostics
f39f21d8 2129
ba370e9b 2130=over 4
2131
2132=item *
2133
77c8cf41 2134All regular expression compilation error messages are now hopefully
2135easier to understand both because the error message now comes before
2136the failed regex and because the point of failure is now clearly
ba370e9b 2137marked by a C<E<lt>-- HERE> marker.
2138
2139=item *
f39f21d8 2140
77c8cf41 2141The various "opened only for", "on closed", "never opened" warnings
2142drop the C<main::> prefix for filehandles in the C<main> package,
bea4d472 2143for example C<STDIN> instead of C<main::STDIN>.
f39f21d8 2144
ba370e9b 2145=item *
2146
77c8cf41 2147The "Unrecognized escape" warning has been extended to include C<\8>,
2148C<\9>, and C<\_>. There is no need to escape any of the C<\w> characters.
f39f21d8 2149
ba370e9b 2150=item *
f39f21d8 2151
77c8cf41 2152Two new debugging options have been added: if you have compiled your
2153Perl with debugging, you can use the -DT and -DR options to trace
2154tokenising and to add reference counts to displaying variables,
2155respectively.
f39f21d8 2156
2157=item *
2158
77c8cf41 2159If an attempt to use a (non-blessed) reference as an array index
2160is made, a warning is given.
f39f21d8 2161
2162=item *
2163
77c8cf41 2164C<push @a;> and C<unshift @a;> (with no values to push or unshift)
2165now give a warning. This may be a problem for generated and evaled
2166code.
f39f21d8 2167
ba370e9b 2168=item *
2169
2170If you try to L<perlfunc/pack> a number less than 0 or larger than 255
2171using the C<"C"> format you will get an optional warning. Similarly
2172for the C<"c"> format and a number less than -128 or more than 127.
2173
2174=item *
2175
2176Certain regex modifiers such as C<(?o)> make sense only if applied to
2177the entire regex. You will an optional warning if you try to do otherwise.
2178
2179=item *
2180
c2e23569 2181Using arrays or hashes as references (e.g. C<< %foo-&gt;{bar} >>
2182has been deprecated for a while. Now you will get an optional warning.
ba370e9b 2183
f39f21d8 2184=back
2185
77c8cf41 2186=head1 Changed Internals
f39f21d8 2187
2188=over 4
2189
2190=item *
2191
77c8cf41 2192perlapi.pod (a companion to perlguts) now attempts to document the
2193internal API.
f39f21d8 2194
2195=item *
2196
77c8cf41 2197You can now build a really minimal perl called microperl.
2198Building microperl does not require even running Configure;
2199C<make -f Makefile.micro> should be enough. Beware: microperl makes
2200many assumptions, some of which may be too bold; the resulting
2201executable may crash or otherwise misbehave in wondrous ways.
2202For careful hackers only.
f39f21d8 2203
2204=item *
2205
c2e23569 2206Added rsignal(), whichsig(), do_join(), op_clear, op_null,
2207ptr_table_clear(), ptr_table_free(), sv_setref_uv(), and several UTF-8
2208interfaces to the publicised API. For the full list of the available
2209APIs see L<perlapi>.
f39f21d8 2210
2211=item *
2212
77c8cf41 2213Made possible to propagate customised exceptions via croak()ing.
f39f21d8 2214
77c8cf41 2215=item *
f39f21d8 2216
95f0a2f1 2217Now xsubs can have attributes just like subs. (Well, at least the
2218built-in attributes.)
f39f21d8 2219
2220=item *
2221
77c8cf41 2222dTHR and djSP have been obsoleted; the former removed (because it's
2223a no-op) and the latter replaced with dSP.
f39f21d8 2224
2225=item *
2226
61947107 2227PERL_OBJECT has been completely removed.
2228
2229=item *
2230
ba370e9b 2231The MAGIC constants (e.g. C<'P'>) have been macrofied
2232(e.g. C<PERL_MAGIC_TIED>) for better source code readability
2233and maintainability.
2234
2235=item *
2236
2237The regex compiler now maintains a structure that identifies nodes in
2238the compiled bytecode with the corresponding syntactic features of the
2239original regex expression. The information is attached to the new
2240C<offsets> member of the C<struct regexp>. See L<perldebguts> for more
2241complete information.
2242
2243=item *
2244
2245The C code has been made much more C<gcc -Wall> clean. Some warning
2246messages still remain in some platforms, so if you are compiling with
2247gcc you may see some warnings about dubious practices. The warnings
2248are being worked on.
2249
2250=item *
2251
2252F<perly.c>, F<sv.c>, and F<sv.h> have now been extensively commented.
2253
2254=item *
2255
61947107 2256Documentation on how to use the Perl source repository has been added
2257to F<Porting/repository.pod>.
f39f21d8 2258
888aee59 2259=item *
2260
c2e23569 2261There are now several profiling make targets.
888aee59 2262
77c8cf41 2263=back
f39f21d8 2264
77c8cf41 2265=head1 Security Vulnerability Closed
f39f21d8 2266
77c8cf41 2267(This change was already made in 5.7.0 but bears repeating here.)
f39f21d8 2268
77c8cf41 2269A potential security vulnerability in the optional suidperl component
2270of Perl was identified in August 2000. suidperl is neither built nor
2271installed by default. As of November 2001 the only known vulnerable
2272platform is Linux, most likely all Linux distributions. CERT and
2273various vendors and distributors have been alerted about the vulnerability.
2274See http://www.cpan.org/src/5.0/sperl-2000-08-05/sperl-2000-08-05.txt
2275for more information.
f39f21d8 2276
77c8cf41 2277The problem was caused by Perl trying to report a suspected security
2278exploit attempt using an external program, /bin/mail. On Linux
2279platforms the /bin/mail program had an undocumented feature which
2280when combined with suidperl gave access to a root shell, resulting in
2281a serious compromise instead of reporting the exploit attempt. If you
2282don't have /bin/mail, or if you have 'safe setuid scripts', or if
2283suidperl is not installed, you are safe.
f39f21d8 2284
77c8cf41 2285The exploit attempt reporting feature has been completely removed from
2286Perl 5.8.0 (and the maintenance release 5.6.1, and it was removed also
2287from all the Perl 5.7 releases), so that particular vulnerability
2288isn't there anymore. However, further security vulnerabilities are,
ba370e9b 2289unfortunately, always possible. The suidperl functionality is most
2290probably going to be removed in Perl 5.10. In any case, suidperl
2291should only be used by security experts who know exactly what they are
2292doing and why they are using suidperl instead of some other solution
2293such as sudo (see http://www.courtesan.com/sudo/).
77c8cf41 2294
2295=head1 New Tests
2296
76663d67 2297Several new tests have been added, especially for the F<lib>
2298subsection. There are now about 34 000 individual tests (spread over
2299about 530 test scripts), in the regression suite (5.6.1 has about
230011700 tests, in 258 test scripts) Many of the new tests are introduced
2301by the new modules, but still in general Perl is now more thoroughly
2302tested.
2303
2304Because of the large number of tests, running the regression suite
2305will take considerably longer time than it used to: expect the suite
2306to take up to 4-5 times longer to run than in perl 5.6. In a really
2307fast machine you can hope to finish the suite in about 5 minutes
2308(wallclock time).
77c8cf41 2309
2310The tests are now reported in a different order than in earlier Perls.
2311(This happens because the test scripts from under t/lib have been moved
2312to be closer to the library/extension they are testing.)
2313
f39f21d8 2314=head1 Known Problems
2315
f39f21d8 2316=head2 AIX
2317
2318=over 4
2319
2320=item *
2321
2322In AIX 4.2 Perl extensions that use C++ functions that use statics
2323may have problems in that the statics are not getting initialized.
2324In newer AIX releases this has been solved by linking Perl with
2325the libC_r library, but unfortunately in AIX 4.2 the said library
2326has an obscure bug where the various functions related to time
2327(such as time() and gettimeofday()) return broken values, and
2328therefore in AIX 4.2 Perl is not linked against the libC_r.
2329
2330=item *
2331
2332vac 5.0.0.0 May Produce Buggy Code For Perl
2333
2334The AIX C compiler vac version 5.0.0.0 may produce buggy code,
2335resulting in few random tests failing, but when the failing tests
2336are run by hand, they succeed. We suggest upgrading to at least
2337vac version 5.0.1.0, that has been known to compile Perl correctly.
2338"lslpp -L|grep vac.C" will tell you the vac version.
2339
2340=back
2341
2342=head2 Amiga Perl Invoking Mystery
2343
2344One cannot call Perl using the C<volume:> syntax, that is, C<perl -v>
057b7f2b 2345works, but for example C<bin:perl -v> doesn't. The exact reason isn't
f39f21d8 2346known but the current suspect is the F<ixemul> library.
2347
2348=head2 lib/ftmp-security tests warn 'system possibly insecure'
2349
2350Don't panic. Read INSTALL 'make test' section instead.
2351
2352=head2 Cygwin intermittent failures of lib/Memoize/t/expire_file 11 and 12
2353
2354The subtests 11 and 12 sometimes fail and sometimes work.
2355
2356=head2 HP-UX lib/io_multihomed Fails When LP64-Configured
2357
2358The lib/io_multihomed test may hang in HP-UX if Perl has been
2359configured to be 64-bit. Because other 64-bit platforms do not hang in
2360this test, HP-UX is suspect. All other tests pass in 64-bit HP-UX. The
2361test attempts to create and connect to "multihomed" sockets (sockets
2362which have multiple IP addresses).
2363
2364=head2 HP-UX lib/posix Subtest 9 Fails When LP64-Configured
2365
2366If perl is configured with -Duse64bitall, the successful result of the
2367subtest 10 of lib/posix may arrive before the successful result of the
2368subtest 9, which confuses the test harness so much that it thinks the
2369subtest 9 failed.
2370
2371=head2 Linux With Sfio Fails op/misc Test 48
2372
2373No known fix.
2374
a0aae13b 2375=head2 Mac OS X
2376
2377The following tests are known to fail:
2378
2379 Failed Test Stat Wstat Total Fail Failed List of Failed
2380 -------------------------------------------------------------------------
2381 ../ext/DB_File/t/db-btree.t 0 11 ?? ?? % ??
2382 ../ext/DB_File/t/db-recno.t 149 3 2.01% 61 63 65
2383 ../ext/POSIX/t/posix.t 31 1 3.23% 10
2384 ../lib/warnings.t 450 1 0.22% 316
2385
f39f21d8 2386=head2 OS/390
2387
2388OS/390 has rather many test failures but the situation is actually
2389better than it was in 5.6.0, it's just that so many new modules and
2390tests have been added.
2391
2392 Failed Test Stat Wstat Total Fail Failed List of Failed
2393 -----------------------------------------------------------------------------
2394 ../ext/B/Deparse.t 14 1 7.14% 14
2395 ../ext/B/Showlex.t 1 1 100.00% 1
2396 ../ext/Encode/Encode/Tcl.t 610 13 2.13% 592 594 596 598
2397 600 602 604-610
2398 ../ext/IO/lib/IO/t/io_unix.t 113 28928 5 3 60.00% 3-5
2399 ../ext/POSIX/POSIX.t 29 1 3.45% 14
2400 ../ext/Storable/t/lock.t 255 65280 5 3 60.00% 3-5
2401 ../lib/locale.t 129 33024 117 19 16.24% 99-117
2402 ../lib/warnings.t 434 1 0.23% 75
2403 ../lib/ExtUtils.t 27 1 3.70% 25
2404 ../lib/Math/BigInt/t/bigintpm.t 1190 1 0.08% 1145
2405 ../lib/Unicode/UCD.t 81 48 59.26% 1-16 49-64 66-81
2406 ../lib/User/pwent.t 9 1 11.11% 4
2407 op/pat.t 660 6 0.91% 242-243 424-425
2408 626-627
2409 op/split.t 0 9 ?? ?? % ??
2410 op/taint.t 174 3 1.72% 156 162 168
2411 op/tr.t 70 3 4.29% 50 58-59
2412 Failed 16/422 test scripts, 96.21% okay. 105/23251 subtests failed, 99.55% okay.
2413
2414=head2 op/sprintf tests 129 and 130
2415
2416The op/sprintf tests 129 and 130 are known to fail on some platforms.
2417Examples include any platform using sfio, and Compaq/Tandem's NonStop-UX.
2418The failing platforms do not comply with the ANSI C Standard, line
241919ff on page 134 of ANSI X3.159 1989 to be exact. (They produce
2420something other than "1" and "-1" when formatting 0.6 and -0.6 using
2421the printf format "%.0f", most often they produce "0" and "-0".)
2422
2423=head2 Failure of Thread tests
2424
fedd8cf1 2425B<Note that support for 5.005-style threading remains experimental
2426and practically unsupported.>
f39f21d8 2427
2428The following tests are known to fail due to fundamental problems in
2429the 5.005 threading implementation. These are not new failures--Perl
24305.005_0x has the same bugs, but didn't have these tests.
2431
fedd8cf1 2432 ext/List/Util/t/first 2
2433 lib/autouse 4
2434 ext/Thread/thr5005 19-20
2435
2436These failures are unlikely to get fixed.
f39f21d8 2437
2438=head2 UNICOS
2439
2440=over 4
2441
2442=item *
2443
2444ext/POSIX/sigaction subtests 6 and 13 may fail.
2445
2446=item *
2447
2448lib/ExtUtils may spuriously claim that subtest 28 failed,
2449which is interesting since the test only has 27 tests.
2450
2451=item *
2452
2453Numerous numerical test failures
2454
2455 op/numconvert 209,210,217,218
2456 op/override 7
2457 ext/Time/HiRes/HiRes 9
2458 lib/Math/BigInt/t/bigintpm 1145
2459 lib/Math/Trig 25
2460
2461These tests fail because of yet unresolved floating point inaccuracies.
2462
2463=back
2464
2465=head2 UTS
2466
2467There are a few known test failures, see L<perluts>.
2468
2469=head2 VMS
2470
00bb525a 2471There is one known test failure with a default configuration:
aecce728 2472
2473 [.run]switches..........................FAILED on test 1
aecce728 2474
f39f21d8 2475=head2 Win32
2476
2477In multi-CPU boxes there are some problems with the I/O buffering:
2478some output may appear twice.
2479
2480=head2 Localising a Tied Variable Leaks Memory
2481
2482 use Tie::Hash;
2483 tie my %tie_hash => 'Tie::StdHash';
2484
2485 ...
2486
2487 local($tie_hash{Foo}) = 1; # leaks
2488
2489Code like the above is known to leak memory every time the local()
2490is executed.
2491
aecce728 2492=head2 Localising Tied Arrays and Hashes Is Broken
2493
2494 local %tied_array;
2495
2496doesn't work as one would expect: the old value is restored
2497incorrectly.
2498
f39f21d8 2499=head2 Self-tying of Arrays and Hashes Is Forbidden
2500
2501Self-tying of arrays and hashes is broken in rather deep and
2502hard-to-fix ways. As a stop-gap measure to avoid people from getting
2503frustrated at the mysterious results (core dumps, most often) it is
2504for now forbidden (you will get a fatal error even from an attempt).
2505
f39f21d8 2506=head2 Building Extensions Can Fail Because Of Largefiles
2507
2508Some extensions like mod_perl are known to have issues with
2509`largefiles', a change brought by Perl 5.6.0 in which file offsets
2510default to 64 bits wide, where supported. Modules may fail to compile
2511at all or compile and work incorrectly. Currently there is no good
2512solution for the problem, but Configure now provides appropriate
2513non-largefile ccflags, ldflags, libswanted, and libs in the %Config
2514hash (e.g., $Config{ccflags_nolargefiles}) so the extensions that are
2515having problems can try configuring themselves without the
2516largefileness. This is admittedly not a clean solution, and the
2517solution may not even work at all. One potential failure is whether
2518one can (or, if one can, whether it's a good idea) link together at
2519all binaries with different ideas about file offsets, all this is
2520platform-dependent.
2521
aecce728 2522=head2 Unicode Support on EBCDIC Still Spotty
2523
2524Though mostly working, Unicode support still has problem spots on
2525EBCDIC platforms. One such known spot are the C<\p{}> and C<\P{}>
2526regular expression constructs for code points less than 256: the
2527pP are testing for Unicode code points, not knowing about EBCDIC.
2528
f39f21d8 2529=head2 The Compiler Suite Is Still Experimental
2530
44da0e71 2531The compiler suite is slowly getting better but it continues to be
2532highly experimental. Use in production environments is discouraged.
f39f21d8 2533
c4f1ce08 2534=head2 The Long Double Support Is Still Experimental
f39f21d8 2535
2536The ability to configure Perl's numbers to use "long doubles",
2537floating point numbers of hopefully better accuracy, is still
2538experimental. The implementations of long doubles are not yet
2539widespread and the existing implementations are not quite mature
2540or standardised, therefore trying to support them is a rare
2541and moving target. The gain of more precision may also be offset
2542by slowdown in computations (more bits to move around, and the
2543operations are more likely to be executed by less optimised
2544libraries).
33a87e58 2545
c4f1ce08 2546=head2 Seen In Perl 5.7 But Gone Now
2547
2548Some modules were seen in the Perl 5.7 development releases
2549but are not present in 5.8.0.
2550
2551=over 4
2552
2553=item *
2554
2555C<Attribute::Handlers> was removed because the implementation of C<my>
2556variable attributes changed so much that the Attribute::Handlers will
2557require a major rewrite. (This means that you can't use
2558Attribute::Handler 0.76 with Perl 5.8.0.)
2559
2560=item *
2561
2562C<Time::Piece> (previously known as C<Time::Object>) was removed
2563because it was felt that it didn't have enough value in it to be a
2564core module. It is still a useful module, though, and is available
2565from the CPAN.
2566
2567=back
2568
cc0fca54 2569=head1 Reporting Bugs
2570
d4ad863d 2571If you find what you think is a bug, you might check the articles
2572recently posted to the comp.lang.perl.misc newsgroup and the perl
2573bug database at http://bugs.perl.org. There may also be
2574information at http://www.perl.com/perl/, the Perl Home Page.
cc0fca54 2575
2576If you believe you have an unreported bug, please run the B<perlbug>
2577program included with your release. Be sure to trim your bug down
2578to a tiny but sufficient test case. Your bug report, along with the
d4ad863d 2579output of C<perl -V>, will be sent off to perlbug@perl.org to be
cc0fca54 2580analysed by the Perl porting team.
2581
2582=head1 SEE ALSO
2583
2584The F<Changes> file for exhaustive details on what changed.
2585
2586The F<INSTALL> file for how to build Perl.
2587
2588The F<README> file for general stuff.
2589
2590The F<Artistic> and F<Copying> files for copyright information.
2591
2592=head1 HISTORY
2593
d468ca04 2594Written by Jarkko Hietaniemi <F<jhi@iki.fi>>.
cc0fca54 2595
2596=cut