Bryan Harris wrote:
Note that the foreach variable is an alias to the loop list so modifying
the variable also modifies the list elements.
Out of curiosity, is it possible to manually create aliases like this as
well? e.g. to make $x an alias to $y?
I do not know the exact answer to your question. Just wanted to mention
that you basically do that with references.
perl -le '
$y = "green";
$x = \$y;
$$x = "red";
print $y;
'
red
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/