"Mark J. Reed" <[EMAIL PROTECTED]> writes: > On Mon, Apr 08, 2002 at 07:56:11PM +0100, Piers Cawley wrote: >> > Also, just wondering: >> > >> > $_[_][EMAIL PROTECTED] _=_0_-_ >> > >> > does that work the way I expect it to? >> >> Dunno, what do you expect it to do?. To my way of thinking there's >> going to be a syntax error at the third '_'. But I'm not entirely >> certain of that. > To me, the third '_' seems like it'd be an unambiguous case of the concatenation > operator. I still can't parse it, however; it looks like an attempt to > modify a non-lvalue: > > $_.[_()] _ @_._() _= _0_() - _() > > That is: > 1. Invoke the subroutine _ (name resolved in current scope) > 2. Dereference the variable $_, yielding an array reference. > 3. Retrieve the element of the referenced array whose index is > the result of step 1. > 4. Invoke the method _ on the array @_. > 5. Concatenate the results of steps 3 and 4 > 6. Invoke the subroutine _0_ > 7. Invoke the _ again (or retrieve the cached result from step 1) > 8. Subtract #7 from #6 > 9. Append the result of step 8 to contents of the lvalue > which is the result of step 5. > > This is where my interpretation fails because the result of step 5 > is not an lvalue.
How do you know that? '_' could be a method on its LHS that returns and object that responds to _=. But generally, I think it's weird. -- Piers "It is a truth universally acknowledged that a language in possession of a rich syntax must be in need of a rewrite." -- Jane Austen?