From: Stephen McCamant Date: Tue, 21 Jul 1998 17:06:23 +0000 (-0500) Subject: applied patch, modulo parts already added to perldelta X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=407eff0f25e20d3ed6ccfe2097b366fd28d8e3c4;p=p5sagit%2Fp5-mst-13.2.git applied patch, modulo parts already added to perldelta Message-Id: <13749.3106.995764.413053@alias-2.pr.mcs.net> Subject: [PATCH] Re: Beta2 is available p4raw-id: //depot/perl@1620 --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 6213685..659cb2f 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -155,9 +155,9 @@ 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. -=head2 Behavior of local() on composites is now well-defined +=head2 Behavior of local() on array and hash elements is now well-defined -See L. +See L. =head2 C<%!> is transparently tied to the L module @@ -171,10 +171,6 @@ See L. See L. -=head2 Slice notation on glob elements is supported - -[XXX See what?] - =head2 Keywords can be globally overridden See L. @@ -277,6 +273,28 @@ Splice() with a negative LENGTH argument now work similar to what the LENGTH did for substr(). Previously a negative LENGTH was treated as 0. See L. +=head2 Magic lvalues are now more magical + +When you say something like C, the scalar returned +by substr() is special, in that any modifications to it affect $x. +(This is called a 'magic lvalue' because an 'lvalue' is something on +the left side of an assignment.) Normally, this is exactly what you +would expect to happen, but Perl uses the same magic if you use substr(), +pos(), or vec() in a context where they might be modified, like taking +a reference with C<\> or as an argument to a sub that modifies C<@_>. +In previous versions, this 'magic' only went one way, but now changes +to the scalar the magic refers to ($x in the above example) affect the +magic lvalue too. For instance, this code now acts differently: + + $x = "hello"; + sub printit { + $x = "g'bye"; + print $_[0], "\n"; + } + printit(substr($x, 0, 5)); + +In previous versions, this would print "hello", but it now prints "g'bye". + =head1 Supported Platforms