[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Current problems
From: |
Akim Demaille |
Subject: |
Re: Current problems |
Date: |
26 Feb 2001 15:01:55 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) |
Akim Demaille <address@hidden> writes:
> Is there anything special about foreach loops?
man perlsyn
Foreach Loops
The `foreach' loop iterates over a normal list value and
sets the variable VAR to be each element of the list in
turn. If the variable is preceded with the keyword `my',
then it is lexically scoped, and is therefore visible only
within the loop. Otherwise, the variable is implicitly
local to the loop and regains its former value upon exitÂ
ing the loop. If the variable was previously declared
with `my', it uses that variable instead of the global
one, but it's still localized to the loop.
and indeed if I
my $am_file = 'foo';
foreach $am_file (@input_files)
I get:
am/tests/testSubDir % am nostromo 15:00
automake: foo.am: required file `./INSTALL' not found
automake: foo.am: required file `./COPYING' not found
so I will make it `local'.