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