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