X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldelta.pod;h=d3fbae5b87b232c2dc1eb3ea07fdf2d286a6b256;hb=0a92e3a8032b83483524fad83a5e76cf0cf6aa8d;hp=409b7b4d9f699646822fd422f60df418237b75d7;hpb=4176c059b9ba6b022e99c44270434a5c3e415b73;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 409b7b4..d3fbae5 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -1,1121 +1,666 @@ =head1 NAME -perldelta - what's new for perl5.004 +perldelta - what's new for perl5.005 =head1 DESCRIPTION -This document describes differences between the 5.003 release (as -documented in I, second edition--the Camel Book) and -this one. +This document describes differences between the 5.004 release and this one. -=head1 Supported Environments +[XXX this needs more verbose summaries of the sub topics, instead of just +the "See foo." Scheduled for a second iteration. GSAR] -Perl5.004 builds out of the box on Unix, Plan9, LynxOS, VMS, OS/2, -QNX, and AmigaOS. +=head1 About the new versioning system -=head1 Core Changes +=head1 Incompatible Changes -Most importantly, many bugs were fixed. See the F -file in the distribution for details. +=head2 WARNING: This version is not binary compatible with Perl 5.004. -=head2 Compilation Option: Binary Compatibility With 5.003 +Starting with Perl 5.004_50 there were many deep and far-reaching changes +to the language internals. If you have dynamically loaded extensions +that you built under perl 5.003 or 5.004, you can continue to use them +with 5.004, but you will need to rebuild and reinstall those extensions +to use them 5.005. See L for detailed instructions on how to +upgrade. -There is a new Configure question that asks if you want to maintain -binary compatibility with Perl 5.003. If you choose binary -compatibility, you do not have to recompile your extensions, but you -might have symbol conflicts if you embed Perl in another application, -just as in the 5.003 release. By default, binary compatibility -is preserved at the expense of symbol table pollution. +=head2 Default installation structure has changed -=head2 [return this line for a free metre of beer -samv 070819] +The new Configure defaults are designed to allow a smooth upgrade from +5.004 to 5.005, but you should read L for a detailed +discussion of the changes in order to adapt them to your system. -If you removed the -w option from your scripts because it was too -noisy, we recommend that you try to put it back when upgrading perl. -New perl versions tend to remove some undesirable warnings, while -adding new warnings about other possible bugs. +=head2 Perl Source Compatibility -=head2 Subroutine arguments created only when they're modified +When none of the experimental features are enabled, there should be +no user-visible Perl source compatibility issue. -In Perl 5.004, nonexistent array and hash elements used as subroutine -parameters are brought into existence only if they are actually -assigned to (via C<@_>). +If threads are enabled, then some caveats apply. C<@_> and C<$_> become +lexical variables. The effect of this should be largely transparent to +the user, but there are some boundary conditions under which user will +need to be aware of the issues. [XXX Add e.g. here.] -Earlier versions of Perl vary in their handling of such arguments. -Perl versions 5.002 and 5.003 always brought them into existence. -Perl versions 5.000, 5.001, and 5.002 brought them into existence only -if they were not the first argument (which was almost certainly a -bug). Earlier versions of Perl never brought them into existence. +Some new keywords have been introduced. These are generally expected to +have very little impact on compatibility. See L keyword>, +L keyword>, and L operator>. -For example, given this code: +Certain barewords are now reserved. Use of these will provoke a warning +if you have asked for them with the C<-w> switch. +See L is now a reserved word>. - undef @a; undef %a; - sub show { print $_[0] }; - sub change { $_[0]++ }; - show($a[2]); - change($a{b}); +=head2 C Source Compatibility -After this code executes in Perl 5.004, $a{b} exists but $a[2] does -not. In Perl 5.002 and 5.003, both $a{b} and $a[2] would have existed -(but $a[2]'s value would have been undefined). +=item Core sources now require ANSI C compiler -=head2 Fixed Parsing of $$, &$, etc. +=item Enabling threads has source compatibility issues -A bug in previous versions of Perl 5.0 prevented proper parsing of -numeric special variables as symbolic references. That bug has been -fixed. As a result, the string "$$0" is no longer equivalent to -C<$$."0">, but rather to C<${$0}>. To get the old behavior, change -"$$" followed by a digit to "${$}". +=head2 Binary Compatibility -=head2 No Resetting of $. on Implicit Close +This version is NOT binary compatible with older versions. All extensions +will need to be recompiled. -The documentation for Perl 5.0 has always stated that C<$.> is I -reset when an already-open file handle is re-opened with no intervening -call to C. Due to a bug, perl versions 5.000 through 5.0003 -I reset C<$.> under that circumstance; Perl 5.004 does not. +=head2 Security fixes may affect compatibility -=head2 Changes to Tainting Checks +A few taint leaks and taint omissions have been corrected. This may lead +to "failure" of scripts that used to work with older versions. Compiling +with -DINCOMPLETE_TAINTS provides a perl with minimal amounts of changes +to the tainting behavior. But note that the resulting perl will have +known insecurities. -A bug in previous versions may have failed to detect some insecure -conditions when taint checks are turned on. (Taint checks are used -in setuid or setgid scripts, or when explicitly turned on with the -C<-T> invocation option.) Although it's unlikely, this may cause a -previously-working script to now fail -- which should be construed -as a blessing, since that indicates a potentially-serious security -hole was just plugged. +Oneliners with the C<-e> switch do not create temporary files anymore. -=head2 New Opcode Module and Revised Safe Module +=head2 Relaxed new mandatory warnings introduced in 5.004 -A new Opcode module supports the creation, manipulation and -application of opcode masks. The revised Safe module has a new API -and is implemented using the new Opcode module. Please read the new -Opcode and Safe documentation. +Many new warnings that were introduced in 5.004 have been made +optional. Some of these warnings are still present, but perl's new +features make them less often a problem. See L. -=head2 Embedding Improvements +=head2 Licensing -In older versions of Perl it was not possible to create more than one -Perl interpreter instance inside a single process without leaking like a -sieve and/or crashing. The bugs that caused this behavior have all been -fixed. However, you still must take care when embedding Perl in a C -program. See the updated perlembed manpage for tips on how to manage -your interpreters. +Perl has a new Social Contract for contributors. See F. -=head2 Internal Change: FileHandle Class Based on IO::* Classes +The license included in much of the Perl documentation has changed. +[XXX See where?] -File handles are now stored internally as type IO::Handle. The -FileHandle module is still supported for backwards compatibility, but -it is now merely a front end to the IO::* modules -- specifically, -IO::Handle, IO::Seekable, and IO::File. We suggest, but do not -require, that you use the IO::* modules in new code. +=head1 Core Changes -In harmony with this change, C<*GLOB{FILEHANDLE}> is now a -backward-compatible synonym for C<*STDOUT{IO}>. -=head2 Internal Change: PerlIO internal IO abstraction interface +=head2 Threads -It is now possible to build Perl with AT&T's sfio IO package -instead of stdio. See L for more details, and -the F file for how to use it. +WARNING: Threading is considered an experimental feature. Details of the +implementation may change without notice. There are known limitations +and and some bugs. -=head2 New and Changed Built-in Variables +See L. -=over +=head2 Compiler -=item $^E +WARNING: The Compiler and related tools are considered experimental. +Features may change without notice, and there are known limitations +and bugs. -Extended error message on some platforms. (Also known as -$EXTENDED_OS_ERROR if you C). +The Compiler produces three different types of transformations of a +perl program. The C backend generates C code that captures perl's state +just before execution begins. It eliminates the compile-time overheads +of the regular perl interpreter, but the run-time performance remains +comparatively the same. The CC backend generates optimized C code +equivivalent to the code path at run-time. The CC backend has greater +potential for big optimizations, but only a few optimizations are +implemented currently. The Bytecode backend generates a platform +independent bytecode representation of the interpreter's state +just before execution. Thus, the Bytecode back end also eliminates +much of the compilation overhead of the interpreter. -=item $^H +The compiler comes with several valuable utilities. -The current set of syntax checks enabled by C. See the -documentation of C for more details. Not actually new, but -newly documented. -Because it is intended for internal use by Perl core components, -there is no C long name for this variable. +C is an experimental module to detect and warn about suspicious +code, especially the cases that the C<-w> switch does not detect. -=item $^M +C can be used to demystify perl code, and understand +how perl optimizes certain constructs. -By default, running out of memory it is not trappable. However, if -compiled for this, Perl may use the contents of C<$^M> as an emergency -pool after die()ing with this message. Suppose that your Perl were -compiled with -DEMERGENCY_SBRK and used Perl's malloc. Then +C generates cross reference reports of all definition and use +of variables, subroutines and formats in a program. - $^M = 'a' x (1<<16); +C show the lexical variables used by a subroutine or file +at a glance. -would allocate a 64K buffer for use when in emergency. -See the F file for information on how to enable this option. -As a disincentive to casual use of this advanced feature, -there is no C long name for this variable. +C is a simple frontend for compiling perl. -=back +See C. -=head2 New and Changed Built-in Functions +=head2 Regular Expressions -=over - -=item delete on slices +See L and L. -This now works. (e.g. C) +=head2 Improved malloc() -=item flock +See banner at the beginning of C for details. -is now supported on more platforms, prefers fcntl to lockf when -emulating, and always flushes before (un)locking. +=head2 Quicksort is internally implemented -=item printf and sprintf +See C. -now support "%i" as a synonym for "%d", and the "h" modifier. -So "%hi" means "short integer in decimal", and "%ho" means -"unsigned short integer as octal". +=head2 Reliable signals -=item keys as an lvalue +Two kinds. -As an lvalue, C allows you to increase the number of hash buckets -allocated for the given hash. This can gain you a measure of efficiency if -you know the hash is going to get big. (This is similar to pre-extending -an array by assigning a larger number to $#array.) If you say +Via C. - keys %hash = 200; +Via switched runtime op loop. [XXX Not yet available.] -then C<%hash> will have at least 200 buckets allocated for it. These -buckets will be retained even if you do C<%hash = ()>; use C if you want to free the storage while C<%hash> is still in scope. -You can't shrink the number of buckets allocated for the hash using -C in this way (but you needn't worry about doing this by accident, -as trying has no effect). +=head2 Reliable stack pointers -=item my() in Control Structures +The internals now reallocate the perl stack only at predictable times. +In particular, magic calls never trigger reallocations of the stack, +because all reentrancy of the runtime is handled using a "stack of stacks". +This should improve reliability of cached stack pointers in the internals +and in XSUBs. -You can now use my() (with or without the parentheses) in the control -expressions of control structures such as: +=head2 Behavior of local() on composites is now well-defined - while (defined(my $line = <>)) { - $line = lc $line; - } continue { - print $line; - } +See L. - if ((my $answer = ) =~ /^y(es)?$/i) { - user_agrees(); - } elsif ($answer =~ /^n(o)?$/i) { - user_disagrees(); - } else { - chomp $answer; - die "`$answer' is neither `yes' nor `no'"; - } +=head2 C<%!> is transparently tied to the L module -Also, you can declare a foreach loop control variable as lexical by -preceding it with the word "my". For example, in: +See L, and L. - foreach my $i (1, 2, 3) { - some_function(); - } +=head2 Pseudo-hashes are supported -$i is a lexical variable, and the scope of $i extends to the end of -the loop, but not beyond it. +See L. -Note that you still cannot use my() on global punctuation variables -such as $_ and the like. +=head2 C is supported -=item unpack() and pack() +See L. -A new format 'w' represents a BER compressed integer (as defined in -ASN.1). Its format is a sequence of one or more bytes, each of which -provides seven bits of the total value, with the most significant -first. Bit eight of each byte is set, except for the last byte, in -which bit eight is clear. +=head2 Slice notation on glob elements is supported -=item use VERSION +[XXX See what?] -If the first argument to C is a number, it is treated as a version -number instead of a module name. If the version of the Perl interpreter -is less than VERSION, then an error message is printed and Perl exits -immediately. Because C occurs at compile time, this check happens -immediately during the compilation process, unlike C, -which waits until run-time for the check. This is often useful if you -need to check the current Perl version before Cing library modules -which have changed in incompatible ways from older versions of Perl. -(We try not to do this more than we have to.) +=head2 Keywords can be globally overridden -=item use Module VERSION LIST +See L. -If the VERSION argument is present between Module and LIST, then the -C will call the VERSION method in class Module with the given -version as an argument. The default VERSION method, inherited from -the Universal class, croaks if the given version is larger than the -value of the variable $Module::VERSION. (Note that there is not a -comma after VERSION!) +=head2 C<$^E> is meaningful on Win32 -This version-checking mechanism is similar to the one currently used -in the Exporter module, but it is faster and can be used with modules -that don't use the Exporter. It is the recommended method for new -code. +See L. -=item prototype(FUNCTION) +=head2 C optimized -Returns the prototype of a function as a string (or C if the -function has no prototype). FUNCTION is a reference to or the name of the -function whose prototype you want to retrieve. -(Not actually new; just never documented before.) +C is now optimized into a counting loop. It does +not try to allocate a 1000000-size list anymore. -=item srand +=head2 C can be used as implicitly quoted package name -The default seed for C, which used to be C