X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperl593delta.pod;h=80f8cb925fbf6fac5bf35bae55eeb16c5e7f73e8;hb=997e7b23827e884e717eba50697f2e5714034828;hp=46cde57195727d38ca79e2e8ff4db10ac6b24620;hpb=ffabe59cd168b31758e4893034c1cb9c41c4992a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perl593delta.pod b/pod/perl593delta.pod index 46cde57..80f8cb9 100644 --- a/pod/perl593delta.pod +++ b/pod/perl593delta.pod @@ -1,6 +1,6 @@ =head1 NAME -perldelta - what is new for perl v5.9.3 +perl593delta - what is new for perl v5.9.3 =head1 DESCRIPTION @@ -12,8 +12,9 @@ L for the differences between 5.8.0 and 5.9.2. =head2 Parsing of C<-f _> -C<_> is now forced to be a bareword after a filetest operator. This solves -a number of misparsing issues when a global C<_> subroutine is defined. +The identifier C<_> is now forced to be a bareword after a filetest +operator. This solves a number of misparsing issues when a global C<_> +subroutine is defined. =head2 C @@ -43,7 +44,7 @@ The C pragma is now lexically scoped. Its effect used to be global. =head2 The C pragma The C pragma is used to enable new syntax that would break Perl's -backward-compatibility with older releases of the language. It's a lexical +backwards-compatibility with older releases of the language. It's a lexical pragma, like C or C. Currently the following new features are available: C (adds a @@ -52,16 +53,37 @@ switch statement), C<~~> (adds a Perl 6-like smart match operator), C Those features are described below. Note that C low-precedence defined-or operator used to be enabled by -default, but as a weak keyword. It's now only recognized when explicitly -turned on. +default (although as a weak keyword, meaning that any function would +override it). It's now only recognized when explicitly turned on (and is +then a regular keyword). + +Those features, and the C pragma itself, have been contributed by +Robin Houston. =head2 Switch and Smart Match operator -XXX +Perl 5 now has a switch statement. It's available when C is in effect. This feature introduces three new keywords, +C, C, and C: + + given ($foo) { + when (/^abc/) { $abc = 1; } + when (/^def/) { $def = 1; } + when (/^xyz/) { $xyz = 1; } + default { $nothing = 1; } + } + +A more complete description of how Perl matches the switch variable +against the C conditions is given in L. + +This kind of match is called I, and it's also possible to use +it outside of switch statements, via the new C<~~> operator (enabled via +the C directive). See L. =head2 C -say() is a new built-in, only avaiable when C is in +say() is a new built-in, only available when C is in effect, that is similar to print(), but that implicitly appends a newline to the printed string. See L. @@ -71,21 +93,21 @@ Perl has now support for the C special subroutine. Like C, C is called once per package; however, it is called just before cloning starts, and in the context of the parent thread. If it returns a true value, then no objects of that class will be cloned. See -L for details. +L for details. (Contributed by Dave Mitchell.) =head2 C<${^CHILD_ERROR_NATIVE}> A new internal variable, C<${^CHILD_ERROR_NATIVE}>, gives the native status returned by the last pipe close, backtick command, successful call to wait() or waitpid(), or from the system() operator. See L for -details. +details. (Contributed by Gisle Aas.) =head2 Assertions The support for assertions, introduced in perl 5.9.0, has been improved. The syntax for the C<-A> command-line switch has changed; it now accepts an optional module name, defaulting to C. See -L and L. +L and L. (Contributed by Salvador Fandiño García.) =head2 Unicode Character Database 4.1.0 @@ -95,11 +117,11 @@ been updated to 4.1.0. =head2 C You can now use C followed by a version number to specify that you -want to use a version of perl inferior to the specified one. +want to use a version of perl older than the specified one. =head2 Recursive sort subs -You can now use recursive subroutines with sort(). +You can now use recursive subroutines with sort(), thanks to Robin Houston. =head2 Effect of pragmas in eval @@ -113,35 +135,107 @@ into eval(""). =head2 New B<-E> command-line switch B<-E> is equivalent to B<-e>, but it implicitly enables all -optional features. +optional features (like C). + +=head2 C, C and C on filehandles + +C, C and C can now work on filehandles as well as +filenames, if the system supports respectively C, C and +C, thanks to a patch provided by Gisle Aas. + +=head2 OS groups + +C<$(> and C<$)> now return groups in the order where the OS returns them, +thanks to Gisle Aas. This wasn't previously the case. =head1 Modules and Pragmata -=head2 C +=head2 New Core Modules + +=over 4 + +=item * + +A new pragma, C, has been added; see above in L. + +=item * + +C, also available on CPAN, allows the use of assertions on +perl versions prior to 5.9.0 (that is the first one to natively support +them). + +=item * + +C is an XS-enabled, and thus faster, version of +C. -This new module implements the C pragma; see above in -L. +=item * + +C is an interface to the zlib compression library. It +comes with a bundled version of zlib, so having a working zlib is not a +prerequisite to install it. It's used by C (see below). + +=item * + +C is an C-style interface to C. -=head2 C +=item * -=head2 C +C is a module to manipulate C archives. -=head2 C +=item * -=head2 C +C is a module used to calculate many types of SHA digests, +has been included for SHA support in the CPAN module. -=head2 C +=item * + +C and C have been added. + +=back =head1 Utility Changes =head2 C +C is a pure perl implementation of C, that comes with +C. + +=head2 C + +C is a small script used to generate a diff between the contents +of a tar archive and a directory tree. Like C, it comes with +C. + +=head2 C + +This command-line utility, used to print or to check SHA digests, comes +with the new C module. + +=head2 C enhancements + +C implements a new option C<--use-xsloader> to force use of +C even in backwards compatible modules. + +The handling of authors' names that had apostrophes has been fixed. + +Any enums with negative values are now skipped. + +=head2 C enhancements + +C no longer checks for F<*.ph> files by default. Use the new C<-a> +option to run I tests. + =head1 Documentation =head2 Perl Glossary The L manpage is a glossary of terms used in the Perl -documentation, technical and otherwise. +documentation, technical and otherwise, kindly provided by O'Reilly Media, +Inc. + +L now lists a rough roadmap to Perl 5.10. =head1 Performance Enhancements @@ -150,12 +244,53 @@ documentation, technical and otherwise. Some pure-perl code that perl was using to retrieve Unicode properties and transliteration mappings has been reimplemented in XS. -=head2 Constants subroutines +=head2 Constant subroutines + +The interpreter internals now support a far more memory efficient form of +inlineable constants. Storing a reference to a constant value in a symbol +table is equivalent to a full typeglob referencing a constant subroutine, +but using about 400 bytes less memory. This proxy constant subroutine is +automatically upgraded to a real typeglob with subroutine if necessary. +The approach taken is analogous to the existing space optimisation for +subroutine stub declarations, which are stored as plain scalars in place +of the full typeglob. + +Several of the core modules have been converted to use this feature for +their system dependent constants - as a result C now takes about +200K less memory. + +=head2 C + +The new compilation flag C, introduced as an option +in perl 5.8.8, is turned on by default in perl 5.9.3. It prevents perl +from creating an empty scalar with every new typeglob. See L +for details. + +=head2 Weak references are cheaper + +Weak reference creation is now I rather than I, courtesy of +Nicholas Clark. Weak reference deletion remains I, but if deletion only +happens at program exit, it may be skipped completely. -XXX +=head2 sort() enhancements + +Salvador Fandiño provided improvements to reduce the memory usage of C +and to speed up some cases. =head1 Installation and Configuration Improvements +=head2 Compilation improvements + +Parallel makes should work properly now, although there may still be problems +if C is instructed to run in parallel. + +Building with Borland's compilers on Win32 should work more smoothly. In +particular Steve Hay has worked to side step many warnings emitted by their +compilers and at least one C compiler internal error. + +Perl extensions on Windows now can be statically built into the Perl DLL, +thanks to a work by Vadim Konovalov. + =head2 New Or Improved Platforms Perl is being ported to Symbian OS. See L for more @@ -170,7 +305,10 @@ improved (Borland C++, Visual C++ 7.0). =head2 New probes -Perl will detect and use internally futimes(2) if available. +C will now detect C and C, thanks to a +patch from Alan Burlison. It will also probe for C (and use it +internally if available), and whether C correctly returns the +length of the formatted string. =head2 Module auxiliary files @@ -196,7 +334,7 @@ anyway.) =head2 Calling CORE::require() CORE::require() and CORE::do() were always parsed as require() and do() -when they were overriden. This is now fixed. +when they were overridden. This is now fixed. =head2 Subscripts of slices @@ -218,10 +356,19 @@ was backed out. Using the sprintf() function with some formats could lead to a buffer overflow in some specific cases. This has been fixed, along with several -other bugs, notably in bound checking. +other bugs, notably in bounds checking. -In related fixes, a format string injection vulnerability has been fixed -in Sys::Syslog. +In related fixes, it was possible for badly written code that did not follow +the documentation of C to have formatting vulnerabilities. +C has been changed to protect people from poor quality third +party code. + +=head2 no warnings 'category' works correctly with -w + +Previously when running with warnings enabled globally via C<-w>, selective +disabling of specific warning categories would actually turn off all warnings. +This is now fixed; now C will only turn off warnings in the +C class. Previously it would erroneously turn off all warnings. =head2 Smaller fixes @@ -239,12 +386,23 @@ less memory-intensive. =item * +Trailing spaces are now trimmed from C<$!> and C<$^E>. + +=item * + +Operations that require perl to read a process' list of groups, such as reads +of C<$(> and C<$)>, now dynamically allocate memory rather than using a +fixed sized array. The fixed size array could cause C stack exhaustion on +systems configured to use large numbers of groups. + +=item * + C now works better with non-default C<$/> settings. =item * -You can now use the C operator to repeat a C list. This used -to raise a syntax error. For example: C. +The C repetition operator is now able to operate on C lists. This +used to raise a syntax error. =item * @@ -258,7 +416,9 @@ opens. =item * -C matches used to loop infinitely on tainted data. +Perl will now use the C library calls C and C if present +to delete keys from C<%ENV> and delete C<%ENV> entirely, thanks to a patch +from Alan Burlison. =back @@ -272,6 +432,18 @@ chr() on a negative value now gives C<\x{FFFD}>, the Unicode replacement character, unless when the C pragma is in effect, where the low eight bytes of the value are used. +=item * + +Some case insensitive matches between UTF-8 encoded data and 8 bit regexps, +and vice versa, could give malformed character warnings. These have been +fixed by Dave Mitchell and Yves Orton. + +=item * + +C and C could corrupt the string for certain cases where +the length UTF-8 encoding of the string in lower case, upper case or title +case differed. This was fixed by Nicholas Clark. + =back =head1 New or Changed Diagnostics @@ -283,6 +455,20 @@ This is a new warning, produced in situations like the following one: $r = do {my @a; \$#a}; $$r = 503; +=head2 Non-string passed as bitmask + +This is a new warning, produced when number has been passed as a argument to +select(), instead of a bitmask. + + # Wrong, will now warn + $rin = fileno(STDIN); + ($nfound,$timeleft) = select($rout=$rin, undef, undef, $timeout); + + # Should be + $rin = ''; + vec($rin,fileno(STDIN),1) = 1; + ($nfound,$timeleft) = select($rout=$rin, undef, undef, $timeout); + =head2 Search pattern not terminated or ternary operator parsed as search pattern This syntax error indicates that the lexer couldn't find the final @@ -298,7 +484,7 @@ of the declarations involved is a C variable: my $x; our $x; # warns our $x; my $x; # warns -On the other hand, the following : +On the other hand, the following: our $x; our $x; @@ -311,7 +497,16 @@ either closed or not really a dirhandle. =head1 Changed Internals -XXX consting +In general, the source code of perl has been refactored, tied up, and +optimized in many places. Also, memory management and allocation has been +improved in a couple of points. + +Andy Lester supplied many improvements to determine which function +parameters and local variables could actually be declared C to the C +compiler. Steve Peters provided new C<*_set> macros and reworked the core to +use these rather than assigning to macros in LVALUE context. + +Dave Mitchell improved the lexer debugging output under C<-DT>. A new file, F, has been added. It contains functions that are no longer used in the perl core, but that remain available for binary or @@ -320,15 +515,14 @@ compiled in if you add C<-DNO_MATHOMS> in the compiler flags. The C macro has been removed. +The C functions, used to manipulate arrays, no longer accept null +C parameters. + =head2 B:: modules inheritance changed The inheritance hierarchy of C modules has changed; C now inherits from C (it used to inherit from C). -=head1 Known Problems - -=head2 Platform Specific Problems - =head1 Reporting Bugs If you find what you think is a bug, you might check the articles