> > if ( ($num_to_return) = want 'LIST' ) {
> > # do stuff
> > }
>
> And more correct as I would assume that
>
> () = some_func();
>
> $num_to_return would be zero, but the assignment would cause the
> if() to be true.
A scalar context C<want> would also need to DWIM, presumably by returning
"0, but true" in that (unusual) situation.
I'll add it explicitly to the RFC.
Thanks, Graham,
Damian
- Re: Change "($one, $two)=" behavior for ... Tom Hughes
- Re: Change "($one, $two)=" behavior for opti... David L. Nicol
- Re: Change "($one, $two)=" behavior for optimizat... Damian Conway
- Re: Change "($one, $two)=" behavior for opti... Nathan Wiger
- Re: Change "($one, $two)=" behavior for opti... Damian Conway
- Re: Change "($one, $two)=" behavior for ... Nathan Wiger
- Re: Change "($one, $two)=" behavior for ... Damian Conway
- Re: Change "($one, $two)=" behavior ... Nathan Wiger
- Re: Change "($one, $two)=" behavior for ... Nathan Wiger
- Re: Change "($one, $two)=" behavior for ... Graham Barr
- Re: Change "($one, $two)=" behavior for ... Damian Conway
- Re: Change "($one, $two)=" behavior ... Nathan Wiger
- Re: Change "($one, $two)=" behavior ... Bart Lateur
- Re: Change "($one, $two)=" behavior ... Damian Conway
