Re: RFC 118 (v1) lvalue subs: parameters, explicit assignment, and wantarray() changes

[email protected] ((Johan Vromans)) 17 Aug 2000 22:37:49 +0200
Newsgroups perl.perl6.language.subs
Message-ID <[email protected]>
Buddha Buck <[email protected]> writes:

> >     $cgi->param($var) += ...
> 
> This is not a pure lvalue, but rather both an lvalue and an rvalue,
> equivalent to:
> 
>       $cgi->param($var) = $cgi->param($var) + ...
> 
> It should evaluate $cgi->param($var) twice, once as an rvalue, and
> once as an lvalue.

I'd say it must evaluate only once. That's the whole idea behind the
+= and friends. (And don't ask me how to do it. I don't know.)

> >     for ( $cgi->param($var) ) {
> >         $_ = ...
> >     }
> >     sysread($fh,$cgi->param($var),...)
> 
> These I'm uncertain how to deal with...

You get the idea...

-- Johan