1PERL590DELTA(1)        Perl Programmers Reference Guide        PERL590DELTA(1)
2
3
4

NAME

6       perl590delta - what is new for perl v5.9.0
7

DESCRIPTION

9       This document describes differences between the 5.8.0 release and the
10       5.9.0 release.
11

Incompatible Changes

13   Hash Randomisation
14       Mainly due to security reasons, the "random ordering" of hashes has
15       been made even more random.  Previously while the order of hash
16       elements from keys(), values(), and each() was essentially random, it
17       was still repeatable.  Now, however, the order varies between different
18       runs of Perl.
19
20       Perl has never guaranteed any ordering of the hash keys, and the
21       ordering has already changed several times during the lifetime of Perl
22       5.  Also, the ordering of hash keys has always been, and continues to
23       be, affected by the insertion order.
24
25       The added randomness may affect applications.
26
27       One possible scenario is when output of an application has included
28       hash data.  For example, if you have used the Data::Dumper module to
29       dump data into different files, and then compared the files to see
30       whether the data has changed, now you will have false positives since
31       the order in which hashes are dumped will vary.  In general the cure is
32       to sort the keys (or the values); in particular for Data::Dumper to use
33       the "Sortkeys" option.  If some particular order is really important,
34       use tied hashes: for example the Tie::IxHash module which by default
35       preserves the order in which the hash elements were added.
36
37       More subtle problem is reliance on the order of "global destruction".
38       That is what happens at the end of execution: Perl destroys all data
39       structures, including user data.  If your destructors (the DESTROY
40       subroutines) have assumed any particular ordering to the global
41       destruction, there might be problems ahead.  For example, in a
42       destructor of one object you cannot assume that objects of any other
43       class are still available, unless you hold a reference to them.  If the
44       environment variable PERL_DESTRUCT_LEVEL is set to a non-zero value, or
45       if Perl is exiting a spawned thread, it will also destruct the ordinary
46       references and the symbol tables that are no longer in use.  You can't
47       call a class method or an ordinary function on a class that has been
48       collected that way.
49
50       The hash randomisation is certain to reveal hidden assumptions about
51       some particular ordering of hash elements, and outright bugs: it
52       revealed a few bugs in the Perl core and core modules.
53
54       To disable the hash randomisation in runtime, set the environment
55       variable PERL_HASH_SEED to 0 (zero) before running Perl (for more
56       information see "PERL_HASH_SEED" in perlrun), or to disable the feature
57       completely in compile time, compile with "-DNO_HASH_SEED" (see
58       INSTALL).
59
60       See "Algorithmic Complexity Attacks" in perlsec for the original
61       rationale behind this change.
62
63   UTF-8 On Filehandles No Longer Activated By Locale
64       In Perl 5.8.0 all filehandles, including the standard filehandles, were
65       implicitly set to be in Unicode UTF-8 if the locale settings indicated
66       the use of UTF-8.  This feature caused too many problems, so the
67       feature was turned off and redesigned: see "Core Enhancements".
68
69   Single-number v-strings are no longer v-strings before "=>"
70       The version strings or v-strings (see "Version Strings" in perldata)
71       feature introduced in Perl 5.6.0 has been a source of some confusion--
72       especially when the user did not want to use it, but Perl thought it
73       knew better.  Especially troublesome has been the feature that before a
74       "=>" a version string (a "v" followed by digits) has been interpreted
75       as a v-string instead of a string literal.  In other words:
76
77               %h = ( v65 => 42 );
78
79       has meant since Perl 5.6.0
80
81               %h = ( 'A' => 42 );
82
83       (at least in platforms of ASCII progeny)  Perl 5.8.1 restored the more
84       natural interpretation
85
86               %h = ( 'v65' => 42 );
87
88       The multi-number v-strings like v65.66 and 65.66.67 still continue to
89       be v-strings in Perl 5.8.
90
91   (Win32) The -C Switch Has Been Repurposed
92       The -C switch has changed in an incompatible way.  The old semantics of
93       this switch only made sense in Win32 and only in the "use utf8"
94       universe in 5.6.x releases, and do not make sense for the Unicode
95       implementation in 5.8.0.  Since this switch could not have been used by
96       anyone, it has been repurposed.  The behavior that this switch enabled
97       in 5.6.x releases may be supported in a transparent, data-dependent
98       fashion in a future release.
99
100       For the new life of this switch, see "UTF-8 no longer default under
101       UTF-8 locales", and "-C" in perlrun.
102
103   (Win32) The /d Switch Of cmd.exe
104       Since version 5.8.1, perl uses the /d switch when running the cmd.exe
105       shell internally for system(), backticks, and when opening pipes to
106       external programs.  The extra switch disables the execution of AutoRun
107       commands from the registry, which is generally considered undesirable
108       when running external programs.  If you wish to retain compatibility
109       with the older behavior, set PERL5SHELL in your environment to "cmd
110       /x/c".
111
112   The $* variable has been removed
113       $*, which was deprecated in favor of the "/s" and "/m" regexp
114       modifiers, has been removed.
115

Core Enhancements

117   Assertions
118       Perl 5.9.0 has experimental support for assertions.  Note that the user
119       interface is not fully stabilized yet, and it may change until the
120       5.10.0 release.  A new command-line switch, -A, is used to activate
121       assertions, which are declared with the "assertions" pragma.  See
122       assertions.
123
124   Defined-or operators
125       A new operator "//" (defined-or) has been implemented.  The following
126       statement:
127
128           $a // $b
129
130       is merely equivalent to
131
132          defined $a ? $a : $b
133
134       and
135
136          $c //= $d;
137
138       can be used instead of
139
140          $c = $d unless defined $c;
141
142       This operator has the same precedence and associativity as "||".  It
143       has a low-precedence counterpart, "err", which has the same precedence
144       and associativity as "or".  Special care has been taken to ensure that
145       those operators Do What You Mean while not breaking old code, but some
146       edge cases involving the empty regular expression may now parse
147       differently.  See perlop for details.
148
149   UTF-8 no longer default under UTF-8 locales
150       In Perl 5.8.0 many Unicode features were introduced.   One of them was
151       found to be of more nuisance than benefit: the automagic (and silent)
152       "UTF-8-ification" of filehandles, including the standard filehandles,
153       if the user's locale settings indicated use of UTF-8.
154
155       For example, if you had "en_US.UTF-8" as your locale, your STDIN and
156       STDOUT were automatically "UTF-8", in other words an implicit
157       binmode(..., ":utf8") was made.  This meant that trying to print, say,
158       chr(0xff), ended up printing the bytes 0xc3 0xbf.  Hardly what you had
159       in mind unless you were aware of this feature of Perl 5.8.0.  The
160       problem is that the vast majority of people weren't: for example in
161       RedHat releases 8 and 9 the default locale setting is UTF-8, so all
162       RedHat users got UTF-8 filehandles, whether they wanted it or not.  The
163       pain was intensified by the Unicode implementation of Perl 5.8.0
164       (still) having nasty bugs, especially related to the use of s/// and
165       tr///.  (Bugs that have been fixed in 5.8.1)
166
167       Therefore a decision was made to backtrack the feature and change it
168       from implicit silent default to explicit conscious option.  The new
169       Perl command line option "-C" and its counterpart environment variable
170       PERL_UNICODE can now be used to control how Perl and Unicode interact
171       at interfaces like I/O and for example the command line arguments.  See
172       "-C" in perlrun and "PERL_UNICODE" in perlrun for more information.
173
174   Unsafe signals again available
175       In Perl 5.8.0 the so-called "safe signals" were introduced.  This means
176       that Perl no longer handles signals immediately but instead "between
177       opcodes", when it is safe to do so.  The earlier immediate handling
178       easily could corrupt the internal state of Perl, resulting in
179       mysterious crashes.
180
181       However, the new safer model has its problems too.  Because now an
182       opcode, a basic unit of Perl execution, is never interrupted but
183       instead let to run to completion, certain operations that can take a
184       long time now really do take a long time.  For example, certain network
185       operations have their own blocking and timeout mechanisms, and being
186       able to interrupt them immediately would be nice.
187
188       Therefore perl 5.8.1 introduced a "backdoor" to restore the pre-5.8.0
189       (pre-5.7.3, really) signal behaviour.  Just set the environment
190       variable PERL_SIGNALS to "unsafe", and the old immediate (and unsafe)
191       signal handling behaviour returns.  See "PERL_SIGNALS" in perlrun and
192       "Deferred Signals (Safe Signals)" in perlipc.
193
194       In completely unrelated news, you can now use safe signals with
195       POSIX::SigAction.  See "POSIX::SigAction" in POSIX.
196
197   Tied Arrays with Negative Array Indices
198       Formerly, the indices passed to "FETCH", "STORE", "EXISTS", and
199       "DELETE" methods in tied array class were always non-negative.  If the
200       actual argument was negative, Perl would call FETCHSIZE implicitly and
201       add the result to the index before passing the result to the tied array
202       method.  This behaviour is now optional.  If the tied array class
203       contains a package variable named $NEGATIVE_INDICES which is set to a
204       true value, negative values will be passed to "FETCH", "STORE",
205       "EXISTS", and "DELETE" unchanged.
206
207   local ${$x}
208       The syntaxes
209
210               local ${$x}
211               local @{$x}
212               local %{$x}
213
214       now do localise variables, given that the $x is a valid variable name.
215
216   Unicode Character Database 4.0.0
217       The copy of the Unicode Character Database included in Perl 5.8 has
218       been updated to 4.0.0 from 3.2.0.  This means for example that the
219       Unicode character properties are as in Unicode 4.0.0.
220
221   Miscellaneous Enhancements
222       "unpack()" now defaults to unpacking the $_.
223
224       "map" in void context is no longer expensive. "map" is now context
225       aware, and will not construct a list if called in void context.
226
227       If a socket gets closed by the server while printing to it, the client
228       now gets a SIGPIPE.  While this new feature was not planned, it fell
229       naturally out of PerlIO changes, and is to be considered an accidental
230       feature.
231
232       PerlIO::get_layers(FH) returns the names of the PerlIO layers active on
233       a filehandle.
234
235       PerlIO::via layers can now have an optional UTF8 method to indicate
236       whether the layer wants to "auto-:utf8" the stream.
237
238       utf8::is_utf8() has been added as a quick way to test whether a scalar
239       is encoded internally in UTF-8 (Unicode).
240

Modules and Pragmata

242   Updated Modules And Pragmata
243       The following modules and pragmata have been updated since Perl 5.8.0:
244
245       base
246       B::Bytecode
247           In much better shape than it used to be.  Still far from perfect,
248           but maybe worth a try.
249
250       B::Concise
251       B::Deparse
252       Benchmark
253           An optional feature, ":hireswallclock", now allows for high
254           resolution wall clock times (uses Time::HiRes).
255
256       ByteLoader
257           See B::Bytecode.
258
259       bytes
260           Now has bytes::substr.
261
262       CGI
263       charnames
264           One can now have custom character name aliases.
265
266       CPAN
267           There is now a simple command line frontend to the CPAN.pm module
268           called cpan.
269
270       Data::Dumper
271           A new option, Pair, allows choosing the separator between hash keys
272           and values.
273
274       DB_File
275       Devel::PPPort
276       Digest::MD5
277       Encode
278           Significant updates on the encoding pragma functionality (tr/// and
279           the DATA filehandle, formats).
280
281           If a filehandle has been marked as to have an encoding, unmappable
282           characters are detected already during input, not later (when the
283           corrupted data is being used).
284
285           The ISO 8859-6 conversion table has been corrected (the 0x30..0x39
286           erroneously mapped to U+0660..U+0669, instead of U+0030..U+0039).
287           The GSM 03.38 conversion did not handle escape sequences correctly.
288           The UTF-7 encoding has been added (making Encode feature-complete
289           with Unicode::String).
290
291       fields
292       libnet
293       Math::BigInt
294           A lot of bugs have been fixed since v1.60, the version included in
295           Perl v5.8.0. Especially noteworthy are the bug in Calc that caused
296           div and mod to fail for some large values, and the fixes to the
297           handling of bad inputs.
298
299           Some new features were added, e.g. the broot() method, you can now
300           pass parameters to config() to change some settings at runtime, and
301           it is now possible to trap the creation of NaN and infinity.
302
303           As usual, some optimizations took place and made the math overall a
304           tad faster. In some cases, quite a lot faster, actually. Especially
305           alternative libraries like Math::BigInt::GMP benefit from this. In
306           addition, a lot of the quite clunky routines like fsqrt() and
307           flog() are now much much faster.
308
309       MIME::Base64
310       NEXT
311           Diamond inheritance now works.
312
313       Net::Ping
314       PerlIO::scalar
315           Reading from non-string scalars (like the special variables, see
316           perlvar) now works.
317
318       podlators
319       Pod::LaTeX
320       PodParsers
321       Pod::Perldoc
322           Complete rewrite.  As a side-effect, no longer refuses to startup
323           when run by root.
324
325       Scalar::Util
326           New utilities: refaddr, isvstring, looks_like_number,
327           set_prototype.
328
329       Storable
330           Can now store code references (via B::Deparse, so not foolproof).
331
332       strict
333           Earlier versions of the strict pragma did not check the parameters
334           implicitly passed to its "import" (use) and "unimport" (no)
335           routine.  This caused the false idiom such as:
336
337                   use strict qw(@ISA);
338                   @ISA = qw(Foo);
339
340           This however (probably) raised the false expectation that the
341           strict refs, vars and subs were being enforced (and that @ISA was
342           somehow "declared").  But the strict refs, vars, and subs are not
343           enforced when using this false idiom.
344
345           Starting from Perl 5.8.1, the above will cause an error to be
346           raised.  This may cause programs which used to execute seemingly
347           correctly without warnings and errors to fail when run under 5.8.1.
348           This happens because
349
350                   use strict qw(@ISA);
351
352           will now fail with the error:
353
354                   Unknown 'strict' tag(s) '@ISA'
355
356           The remedy to this problem is to replace this code with the correct
357           idiom:
358
359                   use strict;
360                   use vars qw(@ISA);
361                   @ISA = qw(Foo);
362
363       Term::ANSIcolor
364       Test::Harness
365           Now much more picky about extra or missing output from test
366           scripts.
367
368       Test::More
369       Test::Simple
370       Text::Balanced
371       Time::HiRes
372           Use of nanosleep(), if available, allows mixing subsecond sleeps
373           with alarms.
374
375       threads
376           Several fixes, for example for join() problems and memory leaks.
377           In some platforms (like Linux) that use glibc the minimum memory
378           footprint of one ithread has been reduced by several hundred
379           kilobytes.
380
381       threads::shared
382           Many memory leaks have been fixed.
383
384       Unicode::Collate
385       Unicode::Normalize
386       Win32::GetFolderPath
387       Win32::GetOSVersion
388           Now returns extra information.
389

Utility Changes

391       The "h2xs" utility now produces a more modern layout:
392       Foo-Bar/lib/Foo/Bar.pm instead of Foo/Bar/Bar.pm.  Also, the
393       boilerplate test is now called t/Foo-Bar.t instead of t/1.t.
394
395       The Perl debugger (lib/perl5db.pl) has now been extensively documented
396       and bugs found while documenting have been fixed.
397
398       "perldoc" has been rewritten from scratch to be more robust and feature
399       rich.
400
401       "perlcc -B" works now at least somewhat better, while "perlcc -c" is
402       rather more broken.  (The Perl compiler suite as a whole continues to
403       be experimental.)
404

New Documentation

406       perl573delta has been added to list the differences between the (now
407       quite obsolete) development releases 5.7.2 and 5.7.3.
408
409       perl58delta and perl581delta have been added: these are the perldeltas
410       of 5.8.0 and 5.8.1, detailing the differences respectively between
411       5.6.0 and 5.8.0, and between 5.8.0 and 5.8.1.
412
413       perlartistic has been added: it is the Artistic License in pod format,
414       making it easier for modules to refer to it.
415
416       perlcheat has been added: it is a Perl cheat sheet.
417
418       perlgpl has been added: it is the GNU General Public License in pod
419       format, making it easier for modules to refer to it.
420
421       perlmacosx has been added to tell about the installation and use of
422       Perl in Mac OS X.
423
424       perlos400 has been added to tell about the installation and use of Perl
425       in OS/400 PASE.
426
427       perlreref has been added: it is a regular expressions quick reference.
428

Installation and Configuration Improvements

430       The Unix standard Perl location, /usr/bin/perl, is no longer
431       overwritten by default if it exists.  This change was very prudent
432       because so many Unix vendors already provide a /usr/bin/perl, but
433       simultaneously many system utilities may depend on that exact version
434       of Perl, so better not to overwrite it.
435
436       One can now specify installation directories for site and vendor man
437       and HTML pages, and site and vendor scripts.  See INSTALL.
438
439       One can now specify a destination directory for Perl installation by
440       specifying the DESTDIR variable for "make install".  (This feature is
441       slightly different from the previous "Configure -Dinstallprefix=...".)
442       See INSTALL.
443
444       gcc versions 3.x introduced a new warning that caused a lot of noise
445       during Perl compilation: "gcc -Ialreadyknowndirectory (warning:
446       changing search order)".  This warning has now been avoided by
447       Configure weeding out such directories before the compilation.
448
449       One can now build subsets of Perl core modules by using the Configure
450       flags "-Dnoextensions=..." and "-Donlyextensions=...", see INSTALL.
451
452   Platform-specific enhancements
453       In Cygwin Perl can now be built with threads ("Configure
454       -Duseithreads").  This works with both Cygwin 1.3.22 and Cygwin 1.5.3.
455
456       In newer FreeBSD releases Perl 5.8.0 compilation failed because of
457       trying to use malloc.h, which in FreeBSD is just a dummy file, and a
458       fatal error to even try to use.  Now malloc.h is not used.
459
460       Perl is now known to build also in Hitachi HI-UXMPP.
461
462       Perl is now known to build again in LynxOS.
463
464       Mac OS X now installs with Perl version number embedded in installation
465       directory names for easier upgrading of user-compiled Perl, and the
466       installation directories in general are more standard.  In other words,
467       the default installation no longer breaks the Apple-provided Perl.  On
468       the other hand, with "Configure -Dprefix=/usr" you can now really
469       replace the Apple-supplied Perl (please be careful).
470
471       Mac OS X now builds Perl statically by default.  This change was done
472       mainly for faster startup times.  The Apple-provided Perl is still
473       dynamically linked and shared, and you can enable the sharedness for
474       your own Perl builds by "Configure -Duseshrplib".
475
476       Perl has been ported to IBM's OS/400 PASE environment.  The best way to
477       build a Perl for PASE is to use an AIX host as a cross-compilation
478       environment.  See README.os400.
479
480       Yet another cross-compilation option has been added: now Perl builds on
481       OpenZaurus, an Linux distribution based on Mandrake + Embedix for the
482       Sharp Zaurus PDA.  See the Cross/README file.
483
484       Tru64 when using gcc 3 drops the optimisation for toke.c to "-O2"
485       because of gigantic memory use with the default "-O3".
486
487       Tru64 can now build Perl with the newer Berkeley DBs.
488
489       Building Perl on WinCE has been much enhanced, see README.ce and
490       README.perlce.
491

Selected Bug Fixes

493   Closures, eval and lexicals
494       There have been many fixes in the area of anonymous subs, lexicals and
495       closures.  Although this means that Perl is now more "correct", it is
496       possible that some existing code will break that happens to rely on the
497       faulty behaviour.  In practice this is unlikely unless your code
498       contains a very complex nesting of anonymous subs, evals and lexicals.
499
500   Generic fixes
501       If an input filehandle is marked ":utf8" and Perl sees illegal UTF-8
502       coming in when doing "<FH>", if warnings are enabled a warning is
503       immediately given - instead of being silent about it and Perl being
504       unhappy about the broken data later.  (The ":encoding(utf8)" layer also
505       works the same way.)
506
507       binmode(SOCKET, ":utf8") only worked on the input side, not on the
508       output side of the socket.  Now it works both ways.
509
510       For threaded Perls certain system database functions like getpwent()
511       and getgrent() now grow their result buffer dynamically, instead of
512       failing.  This means that at sites with lots of users and groups the
513       functions no longer fail by returning only partial results.
514
515       Perl 5.8.0 had accidentally broken the capability for users to define
516       their own uppercase<->lowercase Unicode mappings (as advertised by the
517       Camel).  This feature has been fixed and is also documented better.
518
519       In 5.8.0 this
520
521               $some_unicode .= <FH>;
522
523       didn't work correctly but instead corrupted the data.  This has now
524       been fixed.
525
526       Tied methods like FETCH etc. may now safely access tied values, i.e.
527       resulting in a recursive call to FETCH etc.  Remember to break the
528       recursion, though.
529
530       At startup Perl blocks the SIGFPE signal away since there isn't much
531       Perl can do about it.  Previously this blocking was in effect also for
532       programs executed from within Perl.  Now Perl restores the original
533       SIGFPE handling routine, whatever it was, before running external
534       programs.
535
536       Linenumbers in Perl scripts may now be greater than 65536, or 2**16.
537       (Perl scripts have always been able to be larger than that, it's just
538       that the linenumber for reported errors and warnings have "wrapped
539       around".)  While scripts that large usually indicate a need to rethink
540       your code a bit, such Perl scripts do exist, for example as results
541       from generated code.  Now linenumbers can go all the way to 4294967296,
542       or 2**32.
543
544   Platform-specific fixes
545       Linux
546
547       ·   Setting $0 works again (with certain limitations that Perl cannot
548           do much about: see "$0" in perlvar)
549
550       HP-UX
551
552       ·   Setting $0 now works.
553
554       VMS
555
556       ·   Configuration now tests for the presence of "poll()", and IO::Poll
557           now uses the vendor-supplied function if detected.
558
559       ·   A rare access violation at Perl start-up could occur if the Perl
560           image was installed with privileges or if there was an identifier
561           with the subsystem attribute set in the process's rightslist.
562           Either of these circumstances triggered tainting code that
563           contained a pointer bug.  The faulty pointer arithmetic has been
564           fixed.
565
566       ·   The length limit on values (not keys) in the %ENV hash has been
567           raised from 255 bytes to 32640 bytes (except when the
568           PERL_ENV_TABLES setting overrides the default use of logical names
569           for %ENV).  If it is necessary to access these long values from
570           outside Perl, be aware that they are implemented using search list
571           logical names that store the value in pieces, each 255-byte piece
572           (up to 128 of them) being an element in the search list. When doing
573           a lookup in %ENV from within Perl, the elements are combined into a
574           single value.  The existing VMS-specific ability to access
575           individual elements of a search list logical name via the
576           $ENV{'foo;N'} syntax (where N is the search list index) is
577           unimpaired.
578
579       ·   The piping implementation now uses local rather than global DCL
580           symbols for inter-process communication.
581
582       ·   File::Find could become confused when navigating to a relative
583           directory whose name collided with a logical name.  This problem
584           has been corrected by adding directory syntax to relative path
585           names, thus preventing logical name translation.
586
587       Win32
588
589       ·   A memory leak in the fork() emulation has been fixed.
590
591       ·   The return value of the ioctl() built-in function was accidentally
592           broken in 5.8.0.  This has been corrected.
593
594       ·   The internal message loop executed by perl during blocking
595           operations sometimes interfered with messages that were external to
596           Perl.  This often resulted in blocking operations terminating
597           prematurely or returning incorrect results, when Perl was executing
598           under environments that could generate Windows messages.  This has
599           been corrected.
600
601       ·   Pipes and sockets are now automatically in binary mode.
602
603       ·   The four-argument form of select() did not preserve $! (errno)
604           properly when there were errors in the underlying call.  This is
605           now fixed.
606
607       ·   The "CR CR LF" problem of has been fixed, binmode(FH, ":crlf") is
608           now effectively a no-op.
609

New or Changed Diagnostics

611       All the warnings related to pack() and unpack() were made more
612       informative and consistent.
613
614   Changed "A thread exited while %d threads were running"
615       The old version
616
617           A thread exited while %d other threads were still running
618
619       was misleading because the "other" included also the thread giving the
620       warning.
621
622   Removed "Attempt to clear a restricted hash"
623       It is not illegal to clear a restricted hash, so the warning was
624       removed.
625
626   New "Illegal declaration of anonymous subroutine"
627       You must specify the block of code for "sub".
628
629   Changed "Invalid range "%s" in transliteration operator"
630       The old version
631
632           Invalid [] range "%s" in transliteration operator
633
634       was simply wrong because there are no "[] ranges" in tr///.
635
636   New "Missing control char name in \c"
637       Self-explanatory.
638
639   New "Newline in left-justified string for %s"
640       The padding spaces would appear after the newline, which is probably
641       not what you had in mind.
642
643   New "Possible precedence problem on bitwise %c operator"
644       If you think this
645
646           $x & $y == 0
647
648       tests whether the bitwise AND of $x and $y is zero, you will like this
649       warning.
650
651   New "read() on %s filehandle %s"
652       You cannot read() (or sysread()) from a closed or unopened filehandle.
653
654   New "Tied variable freed while still in use"
655       Something pulled the plug on a live tied variable, Perl plays safe by
656       bailing out.
657
658   New "To%s: illegal mapping '%s'"
659       An illegal user-defined Unicode casemapping was specified.
660
661   New "Use of freed value in iteration"
662       Something modified the values being iterated over.  This is not good.
663

Changed Internals

665       These news matter to you only if you either write XS code or like to
666       know about or hack Perl internals (using Devel::Peek or any of the
667       "B::" modules counts), or like to run Perl with the "-D" option.
668
669       The embedding examples of perlembed have been reviewed to be up to date
670       and consistent: for example, the correct use of PERL_SYS_INIT3() and
671       PERL_SYS_TERM().
672
673       Extensive reworking of the pad code (the code responsible for lexical
674       variables) has been conducted by Dave Mitchell.
675
676       Extensive work on the v-strings by John Peacock.
677
678       UTF-8 length and position cache: to speed up the handling of Unicode
679       (UTF-8) scalars, a cache was introduced.  Potential problems exist if
680       an extension bypasses the official APIs and directly modifies the PV of
681       an SV: the UTF-8 cache does not get cleared as it should.
682
683       APIs obsoleted in Perl 5.8.0, like sv_2pv, sv_catpvn, sv_catsv,
684       sv_setsv, are again available.
685
686       Certain Perl core C APIs like cxinc and regatom are no longer available
687       at all to code outside the Perl core of the Perl core extensions.  This
688       is intentional.  They never should have been available with the shorter
689       names, and if you application depends on them, you should (be ashamed
690       and) contact perl5-porters to discuss what are the proper APIs.
691
692       Certain Perl core C APIs like "Perl_list" are no longer available
693       without their "Perl_" prefix.  If your XS module stops working because
694       some functions cannot be found, in many cases a simple fix is to add
695       the "Perl_" prefix to the function and the thread context "aTHX_" as
696       the first argument of the function call.  This is also how it should
697       always have been done: letting the Perl_-less forms to leak from the
698       core was an accident.  For cleaner embedding you can also force this
699       for all APIs by defining at compile time the cpp define
700       PERL_NO_SHORT_NAMES.
701
702       Perl_save_bool() has been added.
703
704       Regexp objects (those created with "qr") now have S-magic rather than
705       R-magic.  This fixed regexps of the form /...(??{...;$x})/ to no longer
706       ignore changes made to $x.  The S-magic avoids dropping the caching
707       optimization and making (??{...}) constructs obscenely slow (and
708       consequently useless).  See also "Magic Variables" in perlguts.
709       Regexp::Copy was affected by this change.
710
711       The Perl internal debugging macros DEBUG() and DEB() have been renamed
712       to PERL_DEBUG() and PERL_DEB() to avoid namespace conflicts.
713
714       "-DL" removed (the leaktest had been broken and unsupported for years,
715       use alternative debugging mallocs or tools like valgrind and Purify).
716
717       Verbose modifier "v" added for "-DXv" and "-Dsv", see perlrun.
718

New Tests

720       In Perl 5.8.0 there were about 69000 separate tests in about 700 test
721       files, in Perl 5.9.0 there are about 77000 separate tests in about 780
722       test files.  The exact numbers depend on the Perl configuration and on
723       the operating system platform.
724

Known Problems

726       The hash randomisation mentioned in "Incompatible Changes" is
727       definitely problematic: it will wake dormant bugs and shake out bad
728       assumptions.
729
730       Many of the rarer platforms that worked 100% or pretty close to it with
731       perl 5.8.0 have been left a little bit untended since their maintainers
732       have been otherwise busy lately, and therefore there will be more
733       failures on those platforms.  Such platforms include Mac OS Classic,
734       IBM z/OS (and other EBCDIC platforms), and NetWare.  The most common
735       Perl platforms (Unix and Unix-like, Microsoft platforms, and VMS) have
736       large enough testing and expert population that they are doing well.
737
738   Tied hashes in scalar context
739       Tied hashes do not currently return anything useful in scalar context,
740       for example when used as boolean tests:
741
742               if (%tied_hash) { ... }
743
744       The current nonsensical behaviour is always to return false, regardless
745       of whether the hash is empty or has elements.
746
747       The root cause is that there is no interface for the implementors of
748       tied hashes to implement the behaviour of a hash in scalar context.
749
750   Net::Ping 450_service and 510_ping_udp failures
751       The subtests 9 and 18 of lib/Net/Ping/t/450_service.t, and the subtest
752       2 of lib/Net/Ping/t/510_ping_udp.t might fail if you have an unusual
753       networking setup.  For example in the latter case the test is trying to
754       send a UDP ping to the IP address 127.0.0.1.
755
756   B::C
757       The C-generating compiler backend B::C (the frontend being "perlcc -c")
758       is even more broken than it used to be because of the extensive lexical
759       variable changes.  (The good news is that B::Bytecode and ByteLoader
760       are better than they used to be.)
761

Platform Specific Problems

763   EBCDIC Platforms
764       IBM z/OS and other EBCDIC platforms continue to be problematic
765       regarding Unicode support.  Many Unicode tests are skipped when they
766       really should be fixed.
767
768   Cygwin 1.5 problems
769       In Cygwin 1.5 the io/tell and op/sysio tests have failures for some yet
770       unknown reason.  In 1.5.5 the threads tests stress_cv, stress_re, and
771       stress_string are failing unless the environment variable PERLIO is set
772       to "perlio" (which makes also the io/tell failure go away).
773
774       Perl 5.8.1 does build and work well with Cygwin 1.3: with (uname -a)
775       "CYGWIN_NT-5.0 ... 1.3.22(0.78/3/2) 2003-03-18 09:20 i686 ..."  a 100%
776       "make test"  was achieved with "Configure -des -Duseithreads".
777
778   HP-UX: HP cc warnings about sendfile and sendpath
779       With certain HP C compiler releases (e.g. B.11.11.02) you will get many
780       warnings like this (lines wrapped for easier reading):
781
782         cc: "/usr/include/sys/socket.h", line 504: warning 562:
783           Redeclaration of "sendfile" with a different storage class specifier:
784             "sendfile" will have internal linkage.
785         cc: "/usr/include/sys/socket.h", line 505: warning 562:
786           Redeclaration of "sendpath" with a different storage class specifier:
787             "sendpath" will have internal linkage.
788
789       The warnings show up both during the build of Perl and during certain
790       lib/ExtUtils tests that invoke the C compiler.  The warning, however,
791       is not serious and can be ignored.
792
793   IRIX: t/uni/tr_7jis.t falsely failing
794       The test t/uni/tr_7jis.t is known to report failure under 'make test'
795       or the test harness with certain releases of IRIX (at least IRIX 6.5
796       and MIPSpro Compilers Version 7.3.1.1m), but if run manually the test
797       fully passes.
798
799   Mac OS X: no usemymalloc
800       The Perl malloc ("-Dusemymalloc") does not work at all in Mac OS X.
801       This is not that serious, though, since the native malloc works just
802       fine.
803
804   Tru64: No threaded builds with GNU cc (gcc)
805       In the latest Tru64 releases (e.g. v5.1B or later) gcc cannot be used
806       to compile a threaded Perl (-Duseithreads) because the system
807       "<pthread.h>" file doesn't know about gcc.
808
809   Win32: sysopen, sysread, syswrite
810       As of the 5.8.0 release, sysopen()/sysread()/syswrite() do not behave
811       like they used to in 5.6.1 and earlier with respect to "text" mode.
812       These built-ins now always operate in "binary" mode (even if sysopen()
813       was passed the O_TEXT flag, or if binmode() was used on the file
814       handle).  Note that this issue should only make a difference for disk
815       files, as sockets and pipes have always been in "binary" mode in the
816       Windows port.  As this behavior is currently considered a bug,
817       compatible behavior may be re-introduced in a future release.  Until
818       then, the use of sysopen(), sysread() and syswrite() is not supported
819       for "text" mode operations.
820

TODO

822       Here are some things that are planned for perl 5.10.0 :
823
824       ·   Various Copy-On-Write techniques will be investigated in hopes of
825           speeding up Perl.
826
827       ·   CPANPLUS, Inline, and Module::Build will become core modules.
828
829       ·   The ability to write true lexically scoped pragmas will be
830           introduced, perhaps via a "pragma" pragma.
831
832       ·   Work will continue on the bytecompiler and byteloader.
833
834       ·   v-strings as they currently exist are scheduled to be deprecated.
835           The v-less form (1.2.3) will become a "version object" when used
836           with "use", "require", and $VERSION.  $^V will also be a "version
837           object" so the printf("%vd",...) construct will no longer be
838           needed.  The v-ful version (v1.2.3) will become obsolete.  The
839           equivalence of strings and v-strings (e.g.  that currently 5.8.0 is
840           equal to "\5\8\0") will go away.  There may be no deprecation
841           warning for v-strings, though: it is quite hard to detect when
842           v-strings are being used safely, and when they are not.
843

Reporting Bugs

845       If you find what you think is a bug, you might check the articles
846       recently posted to the comp.lang.perl.misc newsgroup and the perl bug
847       database at http://bugs.perl.org/.  There may also be information at
848       http://www.perl.com/, the Perl Home Page.
849
850       If you believe you have an unreported bug, please run the perlbug
851       program included with your release.  Be sure to trim your bug down to a
852       tiny but sufficient test case.  Your bug report, along with the output
853       of "perl -V", will be sent off to perlbug@perl.org to be analysed by
854       the Perl porting team.  You can browse and search the Perl 5 bugs at
855       http://bugs.perl.org/.
856

SEE ALSO

858       The Changes file for exhaustive details on what changed.
859
860       The INSTALL file for how to build Perl.
861
862       The README file for general stuff.
863
864       The Artistic and Copying files for copyright information.
865
866
867
868perl v5.12.4                      2011-06-01                   PERL590DELTA(1)
Impressum