This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Current problems


Akim Demaille <akim@epita.fr> 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'.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]