Better document the difference between a block and a script.
[p5sagit/p5-mst-13.2.git] / pod / perl572delta.pod
1 =head1 NAME
2
3 perl571delta - what's new for perl v5.7.2
4
5 =head1 DESCRIPTION
6
7 This document describes differences between the 5.7.1 release and the
8 5.7.2 release.  
9
10 (To view the differences between the 5.6.0 release and the 5.7.0
11 release, see L<perl570delta>.  To view the differences between the
12 5.7.0 release and the 5.7.1 release, see L<perl571delta>.)
13
14 =head1 Security Vulnerability Closed
15
16 (This change was already made in 5.7.0 but bears repeating here.)
17
18 A security vulnerability affecting all Perl versions prior to 5.6.1
19 was found in August 2000.  The vulnerability does not affect default
20 installations and as far as is known affects only the Linux platform.
21
22 You should upgrade your Perl to 5.6.1 as soon as possible.  Patches
23 for earlier releases exist but using the patches require full
24 recompilation from the source code anyway, so 5.6.1 is your best
25 choice.
26
27 See http://www.cpan.org/src/5.0/sperl-2000-08-05/sperl-2000-08-05.txt
28 for more information.
29
30 =head1 Incompatible Changes
31
32 =head2 64-bit platforms and malloc
33
34 If your pointers are 64 bits wide, the Perl malloc is no more being
35 used because it simply does not work with 8-byte pointers.  Also,
36 usually the system malloc on such platforms are much better optimized
37 for such large memory models than the Perl malloc.
38
39 =head2 AIX Dynaloading
40
41 The AIX dynaloading now uses the native dlopen interface of AIX,
42 (given the AIX is recent enough) instead of the old emulated interface.
43 This will probably break backward compatibility with compiled modules.
44
45 =head2 Socket Extension Dynamic in VMS
46
47 The Socket extension is now dynamically loaded instead of being
48 statically built in.  This may or may not be a problem with ancient
49 TCP/IP stacks of VMS: we do not know since we weren't able to test
50 Perl in such configurations.
51
52 =head2 Deprecations
53
54 The current user-visible implementation of pseudo-hashes (the weird
55 use of the first array element) is deprecated starting from Perl 5.8.0
56 and will be removed in Perl 5.10.0, and the feature will be
57 implemented differently.  Not only is the current interface rather
58 ugly, but the current implementation slows down normal array and hash
59 use quite noticeably. The 'fields' pragma interface will remain
60 available.
61
62 The syntaxes C<@a->[...]> and  C<@h->{...}> have now been deprecated.
63
64 The suidperl is also considered to be too much a risk to continue
65 maintaining and the suidperl code is likely to be removed in a future
66 release.
67
68 =head1 Core Enhancements
69
70 In general a lot of fixing has happened in the area of Perl's
71 understanding of numbers, both integer and floating point.  Since in
72 many systems the standard number parsing functions like C<strtoul()>
73 and C<atof()> seem to have bugs, Perl tries to work around their
74 deficiencies.  This results hopefully in more accurate numbers.
75
76 =over 4
77
78 =item *
79
80 The rules for allowing underscores (underbars) in numeric constants
81 have been relaxed and simplified: now you can have an underscore
82 B<between digits>.
83
84 =item *
85
86 GMAGIC (right-hand side magic) could in many cases such as string
87 concatenation be invoked too many times.
88
89 =item *
90
91 Lexicals I: lexicals outside an eval "" weren't resolved
92 correctly inside a subroutine definition inside the eval "" if they
93 were not already referenced in the top level of the eval""ed code.
94
95 =item *
96
97 Lexicals II: lexicals leaked at file scope into subroutines that
98 were declared before the lexicals.
99
100 =item *
101
102 Lvalue subroutines can now return C<undef> in list context.
103
104 =item *
105
106 The C<op_clear> and C<op_null> are now exported.
107
108 =item *
109
110 A new special regular expression variable has been introduced:
111 C<$^N>, which contains the most-recently closed group (submatch).
112
113 =item *
114
115 L<utime> now supports C<utime undef, undef, @files> to change the
116 file timestamps to the current time.
117
118 =item *
119
120 The Perl parser has been stress tested using both random input and
121 Markov chain input.
122
123 =item *
124
125 C<eval "v200"> now works.
126
127 =item *
128
129 VMS now works under PerlIO.
130
131 =back
132
133 =head1 Modules and Pragmata
134
135 =head2 New Modules and Distribution
136
137 =over 4
138
139 =item *
140
141 L<Attribute::Handlers> - Simpler definition of attribute handlers
142
143 =item *
144
145 L<ExtUtils::Constant> - generate XS code to import C header constants
146
147 =item *
148
149 L<I18N::LangTags> - functions for dealing with RFC3066-style language tags
150
151 =item *
152
153 L<libnet> - a collection of perl5 modules related to network programming
154
155 Perl installation leaves libnet unconfigured, use F<libnetcfg> to configure.
156
157 =item *
158
159 L<List::Util> - selection of general-utility list subroutines
160
161 =item *
162
163 L<Locale::Maketext> - framework for localization
164
165 =item *
166
167 L<Memoize> - Make your functions faster by trading space for time
168
169 =item *
170
171 L<NEXT> - pseudo-class for method redispatch
172
173 =item *
174
175 L<Scalar::Util> - selection of general-utility scalar subroutines
176
177 =item *
178
179 L<Test::More> - yet another framework for writing test scripts
180
181 =item *
182
183 L<Test::Simple> - Basic utilities for writing tests
184
185 =item *
186
187 L<Time::HiRes> - high resolution ualarm, usleep, and gettimeofday
188
189 =item *
190
191 L<Time::Piece> - Object Oriented time objects
192
193 (Previously known as L<Time::Object>.)
194
195 =back
196
197 =head2 Updated And Improved Modules and Pragmata
198
199 =over 4
200
201 =item *
202
203 L<B::Deparse> module has been significantly enhanced.  It now
204 can deparse almost all of the standard test suite (so that the
205 tests still succeed).  There is a make target "test.deparse"
206 for trying this out.
207
208 =item *
209
210 L<Class::Struct> now assigns the array/hash element if the accessor
211 is called with an array/hash element as the B<sole> argument.
212
213 =item *
214
215 L<Cwd> extension is now (even) faster.
216
217 =item *
218
219 L<DB_File> extension has been updated to version 1.77.
220
221 =item *
222
223 L<Fcntl>, L<Socket>, and L<Sys::Syslog> have been rewritten to use the
224 new-style constant dispatch section (see L<ExtUtils::Constant>).
225
226 =item *
227
228 L<File::Find> is now (again) reentrant.  It also has been made
229 more portable.
230
231 =item *
232
233 L<File::Glob> now supports C<GLOB_LIMIT> constant to limit the
234 size of the returned list of filenames.
235
236 =item *
237
238 L<IO::Socket::INET> now supports C<LocalPort> of zero (usually meaning
239 that the operating system will make one up.)
240
241 =item *
242
243 The L<vars> pragma now supports declaring fully qualified variables.
244 (Something that C<our()> does not and will not support.)
245
246 =back
247
248 =head1 Utility Changes
249
250 =over 4
251
252 =item *
253
254 The F<emacs/e2ctags.pl> is now much faster.
255
256 =item *
257
258 L<h2ph> now supports C trigraphs.
259
260 =item *
261
262 L<h2xs> uses the new L<ExtUtils::Constant> module which will affect
263 newly created extensions that define constants.  Since the new code is
264 more correct (if you have two constants where the first one is a
265 prefix of the second one, the first constant B<never> gets defined),
266 less lossy (it uses integers for integer constant, as opposed to the
267 old code that used floating point numbers even for integer constants),
268 and slightly faster, you might want to consider regenerating your
269 extension code (the new scheme makes regenerating easy).
270
271 =item *
272
273 L<libnetcfg> has been added to configure the libnet.
274
275 =item *
276
277 The F<Pod::Html> (and thusly L<pod2html>) now allows specifying
278 a cache directory.
279
280 =back
281
282 =head1 New Documentation
283
284 =over 4
285
286 =item *
287
288 L<Locale::Maketext::TPJ13> is an article about software localization,
289 originally published in The Perl Journal #13, republished here with
290 kind permission.
291
292 =item *
293
294 More README.$PLATFORM files have been converted into pod, which also
295 means that they also be installed as perl$PLATFORM documentation
296 files.  The new files are L<perlapollo>, L<perlbeos>, L<perldgux>,
297 L<perlhurd>, L<perlmint>, L<perlnetware>, L<perlplan9>, L<perlqnx>,
298 and L<perltru64>.
299
300 =item *
301
302 The F<Todo> and F<Todo-5.6> files have been merged into L<perltodo>.
303
304 =item *
305
306 Use of the F<gprof> tool to profile Perl has been documented in
307 L<perlhack>.  There is a make target "perl.gprof" for generating a
308 gprofiled Perl executable.
309
310 =back
311
312 =head1 Installation and Configuration Improvements
313
314 =head2 New Or Improved Platforms
315
316 =over 4
317
318 =item *
319
320 AIX should now work better with gcc.  Also longdouble support in AIX
321 should be better now.  See L<perlaix>.
322
323 =item *
324
325 AtheOS (http://www.atheos.cx/) is a new platform.
326
327 =item *
328
329 DG/UX platform now supports the 5.005-style threads.  See L<perldgux>.
330
331 =item *
332
333 Several MacOS (Classic) portability patches have been applied.  We
334 hope to get a fully working port by 5.8.0.  (The remaining problems
335 relate to the changed IO model of Perl.)  See L<perlmacos>.
336
337 =item *
338
339 MacOS X (or Darwin) should now be able to build Perl even on HFS+
340 filesystems.  (The case-insensitivity confused the Perl build process.)
341
342 =item *
343
344 NetWare from Novell is now supported.  See L<perlnetware>.
345
346 =item *
347
348 The Amdahl UTS UNIX mainframe platform is now supported.
349
350 =back
351
352 =head2 Generic Improvements
353
354 =over 4
355
356 =item *
357
358 In AFS installations one can configure the root of the AFS to be
359 somewhere else than the default F</afs> by using the Configure
360 parameter C<-Dafsroot=/some/where/else>.
361
362 =item *
363
364 The version of Berkeley DB used when the Perl (and, presumably, the
365 DB_File extension) was built is now available as
366 C<@Config{qw(db_version_major db_version_minor db_version_patch)}>
367 from Perl and as C<DB_VERSION_MAJOR_CFG DB_VERSION_MINOR_CFG
368 DB_VERSION_PATCH_CFG> from C.
369
370 =item *
371
372 The Thread extension is now not built at all under ithreads
373 (C<Configure -Duseithreads>) because it wouldn't work anyway (the
374 Thread extension requires being Configured with C<-Duse5005threads>).
375
376 =item *
377
378 The C<B::Deparse> compiler backend has been so significantly improved
379 that almost the whole Perl test suite passes after being deparsed.  A
380 make target has been added to help in further testing: C<make test.deparse>.
381
382 =back
383
384 =head1 Selected Bug Fixes
385
386 =over 5
387
388 =item *
389
390 The autouse pragma didn't work for Multi::Part::Function::Names.
391
392 =item *
393
394 The behaviour of non-decimal but numeric string constants such as
395 "0x23" was platform-dependent: in some platforms that was seen as 35,
396 in some as 0, in some as a floating point number (don't ask).  This
397 was caused by Perl using the operating system libraries in a situation
398 where the result of the string to number conversion is undefined: now
399 Perl consistently handles such strings as zero in numeric contexts.
400
401 =item *
402
403 L<dprofpp> -R didn't work.
404
405 =item *
406
407 PERL5OPT with embedded spaces didn't work.
408
409 =item *
410
411 L<Sys::Syslog> ignored the C<LOG_AUTH> constant.
412
413 =back
414
415 =head2 Platform Specific Changes and Fixes
416
417 =over 4
418
419 =item *
420
421 Some versions of glibc have a broken modfl().  This affects builds
422 with C<-Duselongdouble>.  This version of Perl detects this brokenness
423 and has a workaround for it.  The glibc release 2.2.2 is known to have
424 fixed the modfl() bug.
425
426 =back
427
428 =head1 New or Changed Diagnostics
429
430 =over 4
431
432 =item *
433
434 In the regular expression diagnostics the C<E<lt>E<lt> HERE> marker
435 introduced in 5.7.0 has been changed to be C<E<lt>-- HERE> since too
436 many people found the C<E<lt>E<lt>> to be too similar to here-document
437 starters.
438
439 =item *
440
441 If you try to L<perlfunc/pack> a number less than 0 or larger than 255
442 using the C<"C"> format you will get an optional warning.  Similarly
443 for the C<"c"> format and a number less than -128 or more than 127.
444
445 =item *
446
447 Certain regex modifiers such as C<(?o)> make sense only if applied to
448 the entire regex.  You will an optional warning if you try to do otherwise.
449
450 =item *
451
452 Using arrays or hashes as references (e.g. C<%foo->{bar}> has been
453 deprecated for a while.  Now you will get an optional warning.
454
455 =back
456
457 =head1 Source Code Enhancements
458
459 =head2 MAGIC constants
460
461 The MAGIC constants (e.g. C<'P'>) have been macrofied
462 (e.g. C<PERL_MAGIC_TIED>) for better source code readability
463 and maintainability.
464
465 =head2 Better commented code
466
467 F<perly.c>, F<sv.c>, and F<sv.h> have now been extensively commented.
468
469 =head2 Regex pre-/post-compilation items matched up
470
471 The regex compiler now maintains a structure that identifies nodes in
472 the compiled bytecode with the corresponding syntactic features of the
473 original regex expression.  The information is attached to the new
474 C<offsets> member of the C<struct regexp>. See L<perldebguts> for more
475 complete information.
476
477 =head2 gcc -Wall
478
479 The C code has been made much more C<gcc -Wall> clean.  Some warning
480 messages still remain, though, so if you are compiling with gcc you
481 will see some warnings about dubious practices.  The warnings are
482 being worked on.
483
484 =head1 New Tests
485
486 Several new tests have been added, especially for the F<lib> subsection.
487
488 The tests are now reported in a different order than in earlier Perls.
489 (This happens because the test scripts from under t/lib have been moved
490 to be closer to the library/extension they are testing.)
491
492 =head1 Known Problems
493
494 Note that unlike other sections in this document (which describe
495 changes since 5.7.0) this section is cumulative containing known
496 problems for all the 5.7 releases.
497
498 =head2 AIX
499
500 =over 4
501
502 =item *
503
504 If Perl is configured to use long doubles the op/int subtests 13 and
505 14 and the ext/POSIX subtest 14 may fail.
506
507 =item *
508
509 If Perl is configured to use threads the op/magic subtest 28 may fail.
510
511 =item *
512
513 vac 5.0.0.0 May Produce Buggy Code For Perl
514
515 The AIX C compiler vac version 5.0.0.0 may produce buggy code,
516 resulting in few random tests failing, but when the failing tests
517 are run by hand, they succeed.  We suggest upgrading to at least
518 vac version 5.0.1.0, that has been known to compile Perl correctly.
519 "lslpp -L|grep vac.C" will tell you the vac version.
520
521 =back
522
523 =head2 Amiga Perl Invoking Mystery
524
525 One cannot call Perl using the C<volume:> syntax, that is, C<perl -v>
526 works, but for example C<bin:perl -v> doesn't.  The exact reason is
527 known but the current suspect is the F<ixemul> library.
528
529 =head2 lib/ftmp-security tests warn 'system possibly insecure'
530
531 Don't panic.  Read INSTALL 'make test' section instead.
532
533 =head2 Cygwin intermittent failures of lib/Memoize/t/expire_file 11 and 12
534
535 The subtests 11 and 12 sometimes fail and sometimes work.
536
537 =head2 HP-UX lib/io_multihomed Fails When LP64-Configur
538
539 The lib/io_multihomed test may hang in HP-UX if Perl has been
540 configured to be 64-bit. Because other 64-bit platforms do not hang in
541 this test, HP-UX is suspect. All other tests pass in 64-bit HP-UX. The
542 test attempts to create and connect to "multihomed" sockets (sockets
543 which have multiple IP addresses).
544
545 =head2  HP-UX lib/posix Subtest 9 Fails When LP64-Configured
546
547 If perl is configured with -Duse64bitall, the successful result of the
548 subtest 10 of lib/posix may arrive before the successful result of the
549 subtest 9, which confuses the test harness so much that it thinks the
550 subtest 9 failed.
551
552 =head2 Linux With Sfio Fails op/misc Test 48
553
554 No known fix.
555
556 =head2 op/sprintf tests 129 and 130
557
558 The op/sprintf tests 129 and 130 are known to fail on some platforms.
559 Examples include any platform using sfio, and Compaq/Tandem's NonStop-UX.
560 The failing platforms do not comply with the ANSI C Standard, line
561 19ff on page 134 of ANSI X3.159 1989 to be exact.  (They produce
562 something else than "1" and "-1" when formatting 0.6 and -0.6 using
563 the printf format "%.0f", most often they produce "0" and "-0".)
564
565 =head2  Failure of Thread tests
566
567 B<Note that support for 5.005-style threading remains experimental.>
568
569 The following tests are known to fail due to fundamental problems in
570 the 5.005 threading implementation. These are not new failures--Perl
571 5.005_0x has the same bugs, but didn't have these tests.
572
573   lib/autouse.t                 4
574   t/lib/thr5005.t               19-20
575
576 =head2 UNICOS
577
578 =over 4
579
580 =item *
581
582 ext/POSIX/sigaction subtests 6 and 13 may fail.
583
584 =item *
585
586 lib/ExtUtils may spuriously claim that subtest 28 failed,
587 which is interesting since the test only has 27 tests.
588
589 =item *
590
591 Numerous numerical test failures
592
593   op/numconvert                 209,210,217,218
594   op/override                   7
595   ext/Time/HiRes/HiRes          9
596   lib/Math/BigInt/t/bigintpm    1145
597   lib/Math/Trig                 25
598
599 These tests fail because of yet unresolved floating point inaccuracies.
600
601 =back
602
603 =head2 UNICOS/mk ext/IPC/SysV/t/sem test 8
604
605 No known fix.
606
607 =head2 UTS
608
609 Many floating point inaccuracies:
610
611   op/numconvert              511,657,658,659,665-667,831,991,1151
612   op/pack                    10,22,149,156
613   op/sprintf                 8,10,13,102-107,134-135,146-153,159-162
614   lib/Math/BigInt/bigintpm   1145,1183
615   lib/Math/Complex           250,257,514,521,722-724,
616                              934,935,945,949,955,956,975,976
617   ext/POSIX/POSIX            14
618
619 =head2 VMS
620
621 DEC C V5.3-006 on OpenVMS VAX V6.2
622  
623   [-.ext.list.util.t]tainted..............FAILED on test 3
624   [-.ext.posix]sigaction..................FAILED on test 7
625   [-.ext.time.hires]hires.................FAILED on test 14
626   [-.lib.file.find]taint..................FAILED on test 17
627   [-.lib.math.bigint.t]bigintpm...........FAILED on test 1183
628   [-.lib.test.simple.t]exit...............FAILED on test 1
629   [.lib]vmsish............................FAILED on test 13
630   [.op]sprintf............................FAILED on test 12
631   Failed 8/399 tests, 91.23% okay.
632
633 DEC C V6.0-001 on OpenVMS Alpha V7.2-1 
634
635   [-.ext.list.util.t]tainted..............FAILED on test 3 
636   [-.lib.file.find]taint..................FAILED on test 17
637   [-.lib.test.simple.t]exit...............FAILED on test 1
638   [.lib]vmsish............................FAILED on test 13
639   Failed 4/399 tests, 92.48% okay.
640
641 Compac C V6.4-005 on OpenVMS Alpha 7.2.1
642
643   [-.ext.b]showlex........................FAILED on test 1
644   [-.ext.list.util.t]tainted..............FAILED on test 3
645   [-.lib.file.find]taint..................FAILED on test 17 
646   [-.lib.test.simple.t]exit...............FAILED on test 1
647   [.lib]vmsish............................FAILED on test 13
648   [.op]misc...............................FAILED on test 49
649   Failed 6/401 tests, 92.77% okay.
650
651 =head2 Localising a Tied Variable Leaks Memory
652
653     use Tie::Hash;
654     tie my %tie_hash => 'Tie::StdHash';
655
656     ...
657
658     local($tie_hash{Foo}) = 1; # leaks
659
660 Code like the above is known to leak memory every time the local()
661 is executed.
662
663 =head2 Self-tying of Arrays and Hashes Is Forbidden
664
665 Self-tying of arrays and hashes is broken in rather deep and
666 hard-to-fix ways.  As a stop-gap measure to avoid people from getting
667 frustrated at the mysterious results (core dumps, most often) it is
668 for now forbidden (you will get a fatal error even from an attempt).
669
670 =head2 Variable Attributes are not Currently Usable for Tieing
671
672 This limitation will hopefully be fixed in future.  (Subroutine
673 attributes work fine for tieing, see L<Attribute::Handlers>).
674
675 =head2 Building Extensions Can Fail Because Of Largefiles
676
677 Some extensions like mod_perl are known to have issues with
678 `largefiles', a change brought by Perl 5.6.0 in which file offsets
679 default to 64 bits wide, where supported.  Modules may fail to compile
680 at all or compile and work incorrectly.  Currently there is no good
681 solution for the problem, but Configure now provides appropriate
682 non-largefile ccflags, ldflags, libswanted, and libs in the %Config
683 hash (e.g., $Config{ccflags_nolargefiles}) so the extensions that are
684 having problems can try configuring themselves without the
685 largefileness.  This is admittedly not a clean solution, and the
686 solution may not even work at all.  One potential failure is whether
687 one can (or, if one can, whether it's a good idea) link together at
688 all binaries with different ideas about file offsets, all this is
689 platform-dependent.
690
691 =head2 The Compiler Suite Is Still Experimental
692
693 The compiler suite is slowly getting better but is nowhere near
694 working order yet.
695
696 =head2 The Long Double Support is Still Experimental
697
698 The ability to configure Perl's numbers to use "long doubles",
699 floating point numbers of hopefully better accuracy, is still
700 experimental.  The implementations of long doubles are not yet
701 widespread and the existing implementations are not quite mature
702 or standardised, therefore trying to support them is a rare
703 and moving target.  The gain of more precision may also be offset
704 by slowdown in computations (more bits to move around, and the
705 operations are more likely to be executed by less optimised
706 libraries).
707
708 =head1 Reporting Bugs
709
710 If you find what you think is a bug, you might check the articles
711 recently posted to the comp.lang.perl.misc newsgroup and the perl
712 bug database at http://bugs.perl.org.  There may also be
713 information at http://www.perl.com/perl/, the Perl Home Page.
714
715 If you believe you have an unreported bug, please run the B<perlbug>
716 program included with your release.  Be sure to trim your bug down
717 to a tiny but sufficient test case.  Your bug report, along with the
718 output of C<perl -V>, will be sent off to perlbug@perl.org to be
719 analysed by the Perl porting team.
720
721 =head1 SEE ALSO
722
723 The F<Changes> file for exhaustive details on what changed.
724
725 The F<INSTALL> file for how to build Perl.
726
727 The F<README> file for general stuff.
728
729 The F<Artistic> and F<Copying> files for copyright information.
730
731 =head1 HISTORY
732
733 Written by Jarkko Hietaniemi <F<jhi@iki.fi>>, with many contributions
734 from The Perl Porters and Perl Users submitting feedback and patches.
735
736 Send omissions or corrections to <F<perlbug@perl.org>>.
737
738 =cut