Populate perl571delta.
[p5sagit/p5-mst-13.2.git] / pod / perl571delta.pod
1 =head1 NAME
2
3 perl571delta - what's new for perl v5.7.1
4
5 =head1 DESCRIPTION
6
7 This document describes differences between the 5.7.0 release and the
8 5.7.1 release.  
9
10 (To view the differences between the 5.6.0 release and the 5.7.0
11 release, see L<perl570delta>).
12
13 =head1 Security Vulnerability Closed
14
15 (This change was already made in 5.7.0 but bears repeating here.)
16
17 A potential security vulnerability in the optional suidperl component
18 of Perl was identified in August 2000.  suidperl is neither built nor
19 installed by default.  As of April 2001 the only known vulnerable
20 platform is Linux, most likely all Linux distributions.  CERT and
21 various vendors and distributors have been alerted about the vulnerability.
22 See http://www.cpan.org/src/5.0/sperl-2000-08-05/sperl-2000-08-05.txt
23 for more information.
24
25 The problem was caused by Perl trying to report a suspected security
26 exploit attempt using an external program, /bin/mail.  On Linux
27 platforms the /bin/mail program had an undocumented feature which
28 when combined with suidperl gave access to a root shell, resulting in
29 a serious compromise instead of reporting the exploit attempt.  If you
30 don't have /bin/mail, or if you have 'safe setuid scripts', or if
31 suidperl is not installed, you are safe.
32
33 The exploit attempt reporting feature has been completely removed from
34 all the Perl 5.7 releases (and will be gone also from the maintenance
35 release 5.6.1), so that particular vulnerability isn't there anymore.
36 However, further security vulnerabilities are, unfortunately, always
37 possible.  The suidperl code is being reviewed and if deemed too risky
38 to continue to be supported, it may be completely removed from future
39 releases.  In any case, suidperl should only be used by security
40 experts who know exactly what they are doing and why they are using
41 suidperl instead of some other solution such as sudo (see
42 http://www.courtesan.com/sudo/).
43
44 =head1 Incompatible Changes
45
46 =over 4
47
48 =item *
49
50 Although "you shouldn't do that", it was possible to write code that
51 depends on Perl's hashed key order (Data::Dumper does this).  The new
52 algorithm "One-at-a-Time" produces a different hashed key order.
53 More details are in L</"Performance Enhancements">.
54
55 =item *
56
57 The list of filenames from glob() (or <...>) is now by default sorted
58 alphabetically to be csh-compliant.  (bsd_glob() does still sort platform
59 natively, ASCII or EBCDIC, unless GLOB_ALPHASORT is specified.)
60
61 =back
62
63 =head1 Retired Features
64
65 The use of chop() is now deprecated.  This has been made easier by
66 rewriting all the examples in the documentation to use chomp() instead.
67
68 =head1 Core Enhancements
69
70 =over 4
71
72 =item *
73
74 AUTOLOAD is now lvaluable.
75
76 =item *
77
78 IO is now by default done via PerlIO rather than system's "stdio".
79 PerlIO allows "layers" to be "pushed" onto a file handle to alter the
80 handle's behaviour.  Layers can be specified at open time via 3-arg
81 form of open:
82
83    open($fh,'>:crlf :utf8', $path) || ...
84
85 or on already opened handles via extended C<binmode>:
86
87    binmode($fh,':encoding(iso-8859-7)');
88
89 The built-in layers are: unix (low level read/write), stdio (as in
90 previous Perls), perlio (re-implementation of stdio buffering in a
91 portable manner), crlf (does CRLF <=> "\n" translation as on Win32,
92 but available on any platform).  A mmap layer may be available if
93 platform supports it (mostly UNIXes).
94
95 Layers to be applied by default may be specified via the 'open' pragma.
96
97 See L</"Installation and Configuration Improvements"> for the effects
98 of PerlIO on your architecture name.
99
100 =item *
101
102 File handles can be marked as accepting Perl's internal encoding of Unicode
103 (UTF-8 or UTF-EBCDIC depending on platfrom) by a pseudo layer ":utf8" :
104
105    open($fh,">:utf8","Uni.txt");
106
107 =item *
108
109 File handles can translate character encodings from/to Perl's internal
110 Unicode form on read/write via the ":encoding()" layer.
111
112 =item *
113
114 File handles can be opened to "in memory" files held in Perl scalars via:
115
116    open($fh,'>', \$variable) || ...
117
118 =item *
119
120 Anonymous temporary files are available without need to
121 'use FileHandle' or other module via
122
123    open($fh,"+>", undef) || ...
124
125 That is a literal undef, not an undefined value.
126
127 =item *
128
129 The list form of C<open> is now implemented for pipes (at least on UNIX):
130
131    open($fh,"-|", 'cat', '/etc/motd')
132
133 creates a pipe, and runs the equivalent of exec('cat', '/etc/motd') in
134 the child process.
135
136 =item *
137
138 The following keywords are now overrideable: chop, chomp, each, keys,
139 pop, push, shift, splice, unshift.
140
141 =item *
142
143 Formats now support zero-padded decimal fields.
144
145 =item *
146
147 Perl now tries internally to use integer values in numeric conversions
148 and basic arithmetics (+ - * /) if the arguments are integers, and
149 tries also to keep the results stored internally as integers.
150 This change leads into often slightly faster and always less lossy
151 arithmetics (previously Perl always preferred floating point numbers
152 in its math)
153
154 =item *
155  
156 The printf and sprintf now support parameter reordering using the
157 C<%\d+\$> and C<*\d+\$> syntaxes.
158
159 =item *
160
161 Unicode in general should be now much more usable.  Unicode can be
162 used in hash keys, Unicode in regular expressions should work now,
163 Unicode in tr/// should work now (though tr/// seems to be a
164 particularly tricky to get right, so you have been warned)
165
166 =item *
167
168 The Unicode Character Database coming with Perl has been upgraded
169 to Unicode 3.1.
170
171 =item *
172
173 The Unicode character classes \p{Blank} and \p{SpacePerl} have been
174 added.  "Blank" is like C isblank(), that is, it contains only
175 "horizontal whitespace" (the space character is, the newline isn't),
176 and the "SpacePerl" is the Unicode equivalent of C<\s> (\p{Space}
177 isn't, since that includes the vertical tabulator character, whereas
178 C<\s> doesn't.)
179
180 =back
181
182 =head2 Modules and Pragmata
183
184 =head2 New Modules
185
186 =over 4
187
188 =item *
189
190 B::Concise is a new compiler backend for walking the Perl syntax tree,
191 printing concise info about ops.  The output is highly customizable,
192 so customizable that B::Terse has been reimplemented in terms of
193 B::Concise.
194
195 =item *
196
197 Class::ISA for reporting the search path for a class's ISA tree,
198 from Sean Burke, has been added.
199
200 =item *
201
202 Cwd has now a split personality: if possible, an extension is used,
203 (this will hopefully be both faster and more secure and robust) but
204 if not possible, the familiar Perl library implementation is used.
205
206 =item *
207
208 Digest, a frontend module for calculating digests (checksums),
209 from Gisle Aas, has been added.
210
211 =item *
212
213 Digest::MD5 for calculating MD5 digests (checksums), from Gisle Aas,
214 has been added.
215
216 NOTE: the MD5 backward compatibility module is purposefully not
217 included since its use is discouraged.
218
219 =item *
220
221 Encode provides a mechanism to translate between different character
222 encodings.  Support for Unicode, ISO-8859-*, ASCII, CP*, KOI8-R, and
223 three variants of EBCDIC are compiled in to the module.  Several other
224 encodings (like Japanese, Chinese, and MacIntosh encodings) are
225 included and will be loaded at runtime.
226
227 Any encoding supported by Encode module is also available to the
228 ":encoding()" layer if PerlIO is used.
229
230 =item *
231
232 Filter::Simple is an easy-to-use frontend to Filter::Util::Call,
233 from Damian Conway.
234
235 =item *
236
237 Filter::Util::Call, from Paul Marquess, provides you with the
238 framework to write I<Source Filters> in Perl.  For most uses
239 the frontend Filter::Simple is to be preferred.
240
241 =item *
242
243 Locale::Constants, Locale::Country, Locale::Currency, and Locale::Language,
244 from Neil Bowers, have been added.  They provide the codes for various
245 locale standards, such as "fr" for France, "usd" for US Dollar, and
246 "jp" for Japanese.
247
248 =item *
249
250 MIME::Base64, from Gisle Aas, allows you to encode data in base64.
251
252 =item *
253
254 MIME::QuotedPrint, from Gisle Aas, allows you to encode data in
255 quoted-printable encoding.
256
257 MIME::QuotedPrint has been enhanced to provide the basic methods
258 necessary to use it with PerlIO::Via as in :
259
260  use MIME::QuotedPrint;
261  open($fh,">Via(MIME::QuotedPrint)",$path)
262
263 =item *
264
265 PerlIO::Scalar provides the IO to "in memory" perl scalars discussed
266 above.  It also serves as an example of a loadable layer.
267
268 =item *
269
270 PerlIO::Via acts as a PerlIO layer and wraps PerlIO layer
271 functionality provided by a class (typically implemented in
272 perl code).
273
274 =item *
275
276 Pod::Text::Overstrike, from Joe Smith, has been added.
277 It converts POD data to formatted overstrike text.
278
279 =item *
280
281 Switch from Damian Conway has been added.  After
282
283         use Switch;
284
285 you have switch() and case() in Perl.
286
287 =item *
288
289 Text::Balanced from Damian Conway has been added, for
290 extracting delimited text sequences from strings.
291
292 =item *
293
294 Tie::RefHash::Nestable, from Edward Avis, allows storing hash references
295 (unlike the standard Tie::Refhash)
296
297 =item *
298
299 XS::Typemap is a test extension that exercizes XS typemaps.
300 Nothing gets installed but for extension writers the code is
301 worth studying.
302
303 =back
304
305 =head2 Updated And Improved Modules and Pragmata
306
307 =over 4
308
309 =item *
310
311 B::Deparse should be now more robust (still far from providing a full
312 roundtrip for any random piece of Perl code).
313
314 =item *
315
316 Class::Struct has now compile-time features.
317
318 =item *
319
320 Math::BigFloat has undergone much fixing.
321
322 =item *
323
324 Devel::Peek now has an interface for the Perl memory statistics
325 (this works only if you are using perl's malloc, and if you have
326 compiled with debugging).
327
328 =item *
329
330 IO::Socket has now atmark() method, which returns true if the socket
331 is positioned at the out-of-band mark.  The method is also exportable
332 as a sockatmark() function.
333
334 =item
335
336 IO::Socket::INET has support for ReusePort option (if your platform
337 suppport it).  The Reuse option has now an alias, ReuseAddr.
338
339 =item *
340
341 Net::Ping has been greatly enhanced.
342
343 =item *
344
345 The C<open> pragma allows layers other than ":raw" and ":crlf" when
346 using PerlIO.
347
348 =item *
349
350 POSIX::sigaction() is now much more flexible and robust.
351
352 =item *
353
354 The Test module has been significantly enhanced.  Its use is
355 greatly recommended for module writers.
356
357 =item *
358
359 The utf8:: name space (as in the pragma) provides various
360 Perl-callable functions to provide low level access to Perl's
361 internal Unicode representation.  At the moment only length()
362 has been implemented.
363
364 =back
365
366 The following modules have been upgraded from CPAN: CPAN, CGI, DB::File,
367 Getopt::Long, Pod::Man, Pod::Text, Storable, Text-Tabs+Wrap.
368
369 =head1 Performance Enhancements
370
371 =over 4
372
373 =item *
374
375 Hashes now use Bob Jenkins "One-at-a-Time" hashing key algorithm
376 (http://burtleburtle.net/bob/hash/doobs.html).
377 This algorithm is reasonably fast while producing a much better spread
378 of values.  Hash values output from the algorithm on a hash of all
379 3-char printable ASCII keys comes much closer to passing the DIEHARD
380 random number generation tests.  According to perlbench, this change
381 has not affected the overall speed of Perl.
382
383 =item *
384
385 unshift() should now be noticeably faster.
386
387 =back
388
389 =head1 Utility Changes
390
391 =over 4
392
393 =item *
394
395 h2xs now produces template README.
396
397 =item *
398
399 s2p has been completely rewritten in Perl.  (It is in fact a full
400 implementation of sed in Perl.)
401
402 =item *
403
404 xsubpp now supports OUT keyword.
405
406 =back
407
408 =head1 New Documentation
409
410 =head2 perlclib
411
412 Internal replacements for standard C library functions.
413
414 =head2 perliol
415
416 Internals of PerlIO with layers.
417
418 =head2 README.aix
419
420 Documentation on compiling Perl on AIX has been added.  AIX has
421 several different C compilers and getting the right patchlevel
422 is essential.  On install README.aix will be installed as L<perlaix>.
423
424 =head2 README.bs2000
425
426 Documentation on compling Perl on the POSIX-BC platform (an EBCDIC
427 mainframe environment) has been added.
428
429 This was formerly known as README.posix-bc but the name was considered
430 to be too confusing (it has nothing to do with the POSIX module or the
431 POSIX standard).  On install README.bs2000 will be installed as L<perlbs2000>.
432
433 =head2 README.macos
434
435 In perl 5.7.1 (and in the 5.6.1) the MacPerl sources have been
436 synchronized with the standard Perl sources.  To compile MacPerl
437 some additional steps are required, and this file documents those
438 steps.  On install README.macos will be installed as L<perlmacos>.
439
440 =head2 README.mpeix
441
442 The README.mpeix has been podified, which means that this information
443 about compiling and using Perl on the MPE/iX miniframe platform will
444 on install be installed as L<perlmpeix>.
445
446 =head2 README.solaris
447
448 README.solaris has been created and Solaris wisdom from elsewhere
449 in the Perl documentation has been collected there.  On install
450 README.solaris will be installed as L<perlsolaris>.
451
452 =head2 README.vos
453
454 The README.vos has been podified, which means that this information
455 about compiling and using Perl on the Stratus VOS miniframe platform will
456 on install be installed as L<perlvos>.
457
458 =head2 Porting/repository.pod
459
460 Documentation on how to use the Perl source repository has been added.
461
462 =head1 Performance Enhancements
463
464 =head1 Installation and Configuration Improvements
465
466 Because PerlIO is now the default on most platforms, "-perlio" doesn't
467 get appended to the $Config{archname} (also known as $^O) anymore.
468 Instead, if you explicitly choose not to use perlio (Configure command
469 line option -Uuseperlio), you will get "-stdio" appended.
470
471 Another change related to the architecture name is that "-64all"
472 (-Duse64bitall, or "maximally 64-bit") is appended only if your pointers
473 are 64 bits wide.
474
475 APPLLIB_EXP, a less-know configuration-time definition, has been
476 documented.  It can be used to prepend site-specific directories
477 to Perl's default search path (@INC), see INSTALL for information.
478
479 Building Berkeley DB3 for compatibility modes for DB, NDBM, and ODBM
480 has been documented in INSTALL.
481
482 If you are on IRIX or Tru64 platforms, new profiling/debugging options
483 have been added, see L</perlhack> for more information about pixie and
484 Third Degree.
485
486 =head2 New Or Improved Platforms
487
488 =over 4
489
490 =item *
491
492 AIX dynamic loading should be now better supported.
493
494 =item *
495
496 AmigaOS has been verified to be happy with Perl after a long pause.
497
498 =item *
499
500 MacOS Classic (MacPerl has of course been available since
501 perl 5.004 but now the source code bases of standard Perl
502 and MacPerl have been synchronised)
503
504 =item *
505
506 NCR MP-RAS
507
508 =item *
509
510 NonStop-UX
511
512 =item *
513
514 Amdahl UTS
515
516 =item *
517
518 z/OS (formerly known as OS/390, formerly known as MVS OE) has now
519 support for dynamic loading.  This is not selected by default,
520 however, you must specify -Dusedl in the arguments of Configure.
521
522 =back
523
524 =head2 Generic Improvements
525
526 =over 4
527
528 =item *
529
530 Configure no longer includes the DBM libraries (dbm, gdbm, db, ndbm)
531 when building the Perl binary.  The only exception to this is SunOS 4.x,
532 which needs them.
533
534 =item *
535
536 Some new Configure symbols, useful for extension writers: d_cmsghdr
537 (for struct cmsgdhr), d_fcntl_can_lock (whether fcntl() can be used
538 for file locking), d_fsync, d_getitimer(), d_getpagsz (for getpagesize(),
539 though you should prefer POSIX::sysconf(_SC_PAGE_SIZE)), d_msghdr_s
540 (for struct msgdhr), need_va_copy (whether one needs to use Perl_va_copy()
541 to copy varargs), d_readv, d_recvmsg, d_sendmsg, sig_size (the number
542 of elements in an array needed to hold all the available signals),
543 d_sockatmark, d_strtoq, d_u32align (whether one needs to access
544 character data aligned by U32 sized pointers), d_ualarm, d_usleep,
545 d_writev.
546
547 =item *
548
549 Removed Configure symbols: the PDP-11 memory model settings: huge,
550 large, medium, models.
551
552 =item *
553
554 SOCKS support is now much more robust.
555
556 =item *
557
558 If your file system supports symbolic links you can build Perl outside
559 of the source directory by
560         
561         mkdir /tmp/perl/build/directory
562         cd /tmp/perl/build/directory
563         sh /path/to/perl/source/Configure -Dmksymlinks ...
564
565 This will create in /tmp/perl/build/directory a tree of symbolic links
566 pointing to files in /path/to/perl/source.  The original files are left
567 unaffected.  After Configure has finished you can just say
568
569         make all test
570
571 and Perl will be built and tested, all in /tmp/perl/build/directory.
572
573 =back
574
575 =head1 Selected Bug Fixes
576
577 Numerous memory leaks have been hunted down.  Most importantly anonymous
578 subs used to leak quite a bit.
579
580 =over 4
581
582 =item *
583
584 Small unpredictactabilities in the order of DESTROYS have been
585 even small.
586
587 =item *
588
589 mkdir() now ignores trailing slashes in the directory name,
590 as mandated by POSIX.
591
592 =item *
593
594 The PERL5OPT environment variable didn't really work before.
595
596 =item *
597
598 All but the first argument of the IO syswrite() method are now optional.
599
600 =item *
601
602 Tie::ARRAY SPLICE method was broken.
603
604 =item *
605
606 vec() now tries to work with characters <= 255 when possible, but it leaves
607 higher character values in place.  In that case, if vec() was used to modify
608 the string, it is no longer considered to be utf8-encoded.
609
610 =back
611
612 =head2 Platform Specific Changes and Fixes
613
614 =over 4
615
616 =item *
617
618 Linux previously had problems related to sockaddrlen when using
619 accept(), revcfrom() (in Perl: recv()), getpeername(), and getsockname().
620
621 =item *
622
623 Previously DYNIX/ptx had problems in its Configure probe for
624 non-blocking I/O.
625
626 =back
627
628 =head1 New or Changed Diagnostics
629
630 Two new debugging options have been added: if you have compiled your
631 Perl with debugging, you can use the -DT and -DR options to trace
632 tokenizing and to add reference counts to displaying variables,
633 respectively.
634
635 =over 4
636
637 =item *
638
639 If an attempt to use a (non-blessed) reference as an array element
640 is made, a warning is given.
641
642 =item *
643
644 C<push @a;> and C<unshift @a;> (with no values to push or unshift)
645 now give a warning.  This may be a problem for generated and evaled
646 code.
647
648 =back
649
650 =head1 Changed Internals
651
652 =over 4
653
654 =item *
655
656 Some new internal APIs: ptr_table_clear, ptr_table_free, sv_setref_uv.
657 For the full list see L<perlapi>.
658
659 =item *
660
661 dTHR and djSP have been obsoleted; the former removed and the latter
662 replaced with dSP.
663
664 =item *
665
666 Perl now uses system malloc instead of Perl malloc in all 64-bit platforms.
667
668 =back
669
670 =head1 Known Problems
671
672 =head2 lib/b test 19
673
674 The test fails in various platforms (PA64 and IA64 are known), but the
675 exact cause is still being investigated.
676
677 =head2 Localizing a Tied Variable Leaks Memory
678
679     use Tie::Hash;
680     tie my %tie_hash => 'Tie::StdHash';
681
682     ...
683
684     local($tie_hash{Foo}) = 1; # leaks
685
686 Code like the above is known to leak memory every time the local()
687 is executed.
688
689 =head2 sigaction test 13 in VMS
690
691 The test is known to fail, whether it's because of VMS of because
692 of faulty test, is not known.
693
694 =head2 sprintf tests 129 and 130
695
696 The op/sprintf tests 129 and 130 are known to fail in some platforms.
697 Examples include any platform using sfio, and Tandem's NonStop-UX.
698 The failing platforms do not comply with the ANSI C Standard, line
699 19ff on page 134 of ANSI X3.159 1989 to be exact.  (They produce
700 something else than "1" and "-1" when formatting 0.6 and -0.6 using
701 the printf format "%.0f", most often they produce "0" and "-0".)
702
703 =head2 Self-tying of Arrays and Hashes Is Forbidden
704
705 Self-tying of arrays and hashes is broken in rather deep and
706 hard-to-fix ways.  As a stop-gap measure to avoid people from getting
707 frustrated at the mysterious results (core dumps, most often) it is
708 for now forbidden (you will get a fatal error even from an attempt).
709
710 =head1 Reporting Bugs
711
712 If you find what you think is a bug, you might check the articles
713 recently posted to the comp.lang.perl.misc newsgroup and the perl
714 bug database at http://bugs.perl.org.  There may also be
715 information at http://www.perl.com/perl/, the Perl Home Page.
716
717 If you believe you have an unreported bug, please run the B<perlbug>
718 program included with your release.  Be sure to trim your bug down
719 to a tiny but sufficient test case.  Your bug report, along with the
720 output of C<perl -V>, will be sent off to perlbug@perl.org to be
721 analysed by the Perl porting team.
722
723 =head1 SEE ALSO
724
725 The F<Changes> file for exhaustive details on what changed.
726
727 The F<INSTALL> file for how to build Perl.
728
729 The F<README> file for general stuff.
730
731 The F<Artistic> and F<Copying> files for copyright information.
732
733 =head1 HISTORY
734
735 Written by Jarkko Hietaniemi <F<jhi@iki.fi>>, with many contributions
736 from The Perl Porters and Perl Users submitting feedback and patches.
737
738 Send omissions or corrections to <F<perlbug@perl.org>>.
739
740 =cut