perlsyn

foreach my $var (@list) -- $var is a reference?

So, I never knew this and I want to get some clarifcation on it. I know if you do foreach (@list){ if you change $_ in that loop it will affect the actual data. But, I did not know that if you did foreach my $var1 (@list){ If you changed $var1 in the loop it would change the actual data. :-/ So, is there a way to loop over @list ...

Perl for loop explanation

I'm looking through perl code and I see this: sub html_filter { my $text = shift; for ($text) { s/&/&amp;/g; s/</&lt;/g; s/>/&gt;/g; s/"/&quot;/g; } return $text; } what does the for loop do in this case and why would you do it this way? ...