Bryan Harris wrote:

[stuff cut out]

It is usually best to declare variables in the smallest scope possible so:

while (more work to do)
{
  my @array = split $string;

  # do work on array
}


Doesn't that try to re-localize (?) the @array variable every time through the loop? i.e. doesn't it re-run the my() function every time through the loop? For some reason I thought that was a no-no.

my() happens when the code is compiled so it is *not* re-run every time through the loop. The assignment happens when the code is run so it is re-run every time.



John
--
Those people who think they know everything are a great
annoyance to those of us who do.        -- Isaac Asimov

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to