X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldelta.pod;h=46bd59b04f6f7d466d5d22d266bc72f9aa51bd93;hb=69cddaa00596e831c0492189df41823d75a1b069;hp=1e329909e8c26ba81c132005dcab87b29b4a07be;hpb=db8878faa51a8a1541a40745a8613adb5db155e4;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 1e32990..46bd59b 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -27,23 +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 Creation of Subroutine argumnets only when necessary +=head2 Subroutine arguments created only when they're modified -In Perl 5.004, array and hash elements used as subroutine parameters -are brought into existence if they did not already exist only if the -argument is actually assigned to. In Perl versions 5.002 and 5.003, -such arguments were always brought into existence. Versions before -5.002 never brought such arguments into existence. -For example, after +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 foo { print $_[0] }; - sub bar { $_[0]++ }; - foo($a[2]); - bar($a{b}); + sub show { print $_[0] }; + sub change { $_[0]++ }; + show($a[2]); + change($a{b}); -$a{b} exists but $a[2] does not in Perl5.004; in Perl 5.002 and 5.003 -both would exist. +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. @@ -273,6 +279,13 @@ string in some way. This change makes it practical to chain C matches together in conjunction with ordinary matches using the C<\G> zero-width assertion. See L and L. +=item C ignores whitespace before ?*+{} + +The C construct has always been intended to ignore all unescaped +whitespace. However, before Perl 5.004, whitespace had the effect of +esacping repeat modifier like "*" or "?". For example, C was +(mis)interpreted as C. This bug has been fixed in 5.004. + =item nested C closures work now Prior to the 5.004 release, nested anonymous functions didn't work