develooper Front page | perl.beginners | Postings from January 2002

'my' for each loop or no ?

Thread Next
From:
Prahlad Vaidyanathan
Date:
January 8, 2002 05:44
Subject:
'my' for each loop or no ?
Message ID:
20020108132848.GA2050@marvin.clone
Hi,

Was wondering which of these 2 pieces of code is more efficient :

<code1>
    my $file ;
    foreach $file (@tarred) { #do something ; }
    foreach $file (@gzipped) { #do something else ; }
</code1>

        OR

<code2>
    foreach my $file (@tarred) { #do something ; }
    foreach my $file (@gzipped) { #do something else ; }
</code2>

pv.
-- 
Prahlad Vaidyanathan <slime@vsnl.net>

drug, n:
	A substance that, injected into a rat, produces a scientific paper.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About