> "BRH" == Bryan R Harris writes:
BRH> I have a curiosity maybe someone here can help with.
BRH> This code:
BRH>@a=(1,2);
BRH>map { $_ = 3 } @a;
BRH>print join(",", @a), "\n";
BRH> ... prints "3,3". That map is changing the @a array as it goes through
it.
BRH> G
On 11/10/09 Tue Nov 10, 2009 1:22 PM, "Bryan R Harris"
scribbled:
>
>
> I have a curiosity maybe someone here can help with.
>
> This code:
>
>@a=(1,2);
>map { $_ = 3 } @a;
>print join(",", @a), "\n";
>
> ... prints "3,3". That map is changing the @a array as it goes through i