On Fri, 15 Jun 2001, Gross, Stephan wrote:
> One of the  things I've been struck by on this list is how often the "my"
> declaration is used.
> For example, I never would have thought of
> foreach my $i (@data)
> What are the advantages to doing this?

I would recomend the use of 'my' and 'use strict' in anything bigger
than a throwaway script.  And -w for testing too.  These will alert
you to many programming errors that would otherwise slip by.

The big advantage for me in using 'my' is Perl yells at me when I do
something dumb, which is a lot. :-)

> A while back someone showed that it
> could speed up execution.  Why would this be?

This I am not sure of.  I can't think of any reason, but am not
too familiar on the internals so don't take my word for it.

--
Ian

Reply via email to