Re: Mass value assigment

On 9 March 2010 11:49, Shlomi Fish <shlomif [at] iglu.org.il> wrote:
> Otherwise you can assign several variables the same initial value using the x
> operator:
>
> my ($x, $y, $z) = (("test") x 3);
>
> Note that both pairs of parentheses on the right are required.

Are the outer pair really required? I would have thought that
assigning to a list puts the RHS in list context anyway without
requiring parenthesis to force it, and testing seems to confirm this.

Phil

--
To unsubscribe, e-mail: beginners-unsubscribe [at] perl.org
For additional commands, e-mail: beginners-help [at] perl.org
http://learn.perl.org/
Philip Potter [ Di, 09 März 2010 13:25 ] [ ID #2034477 ]
Perl » gmane.comp.lang.perl.beginners » Re: Mass value assigment

Vorheriges Thema: Mass value assigment
Nächstes Thema: Re: why on while?