It is fairly unperlish to have large blocks of variable declarations at
the top of a subroutine so throw away variables (like a one used only
within a loop) tend to get declared as they are used.  The only reason I
can think of that would make it faster is that declaring $i this way
tells the compiler that $i is not going to be permanently stored, so it
may stay in a register.


On 15 Jun 2001 13:10:23 -0400, 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?  A while back someone showed that
> it
> could speed up execution.  Why would this be?
>  
> Just curious,
> Steve
> 
> _______________________________________________________
> Stephan Gross       Loral Skynet     908-470-2388     [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> 
> 
>  
--
Today is Sweetmorn, the 20th day of Confusion in the YOLD 3167
Wibble.


Reply via email to