X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldelta.pod;h=46bd59b04f6f7d466d5d22d266bc72f9aa51bd93;hb=69cddaa00596e831c0492189df41823d75a1b069;hp=628ca22f27f4c66843678d5c788523c89aaa9272;hpb=aa6893958c2bfb6fa4ab923c8466c188c65748fd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 628ca22..46bd59b 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -27,12 +27,29 @@ 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 New Opcode Module and Revised Safe Module +=head2 Subroutine arguments created only when they're modified -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. +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<@_>). + +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. + +For example, given this code: + + undef @a; undef %a; + sub show { print $_[0] }; + sub change { $_[0]++ }; + show($a[2]); + change($a{b}); + +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). =head2 Fixed Parsing of $$, &$, etc. @@ -42,13 +59,49 @@ 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 Internal Change: FileHandle Deprecated +=head2 No Resetting of $. on Implicit Close + +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 Changes to Tainting Checks + +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. -Filehandles are now stored internally as type IO::Handle. -Although C and C<*STDOUT{FILEHANDLE}> -are still supported for backwards compatibility, -C (or C or C) and -C<*STDOUT{IO}> are the way of the future. +=head2 New Opcode Module and Revised Safe Module + +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. + +=head2 Embedding Improvements + +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. + +=head2 Internal Change: FileHandle Class Based on IO::* Classes + +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. + +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 @@ -99,8 +152,8 @@ This now works. (e.g. C) =item flock -is now supported on more platforms, and prefers fcntl -to lockf when emulating. +is now supported on more platforms, prefers fcntl to lockf when +emulating, and always flushes before (un)locking. =item printf and sprintf @@ -198,6 +251,19 @@ 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.) +=item srand + +The default seed for C, which used to be C