M
Michele Dondi
While you're correct that the OP's assumption was wrong, this example
does not demonstrate that. Here, you're only printing $_ within the
loop. If the OP had been correct and $_ was in fact a copy of the
values of @a, the output would be the same. The example you meant to
type was:
perl -le'@a=qw/foo bar/; $_ x= 2 for @a; print for @a;'
(or
perl -le'@a=qw/foo bar/; $_ x= 2 for @a; print "@a"'
)
You're right of course.
Michele