in reply to Re: if expression
in thread if expression
#! perl -w scipt use strict; use warnings;Good! But then no need for -w.
Actually, -w and use warnings are scoped differently. -w is dynamically scoped (i.e. it's a global), while use warnings is file/block scoped. In other words, -w affects modules, but use warnings only affects the file its in.
"scipt" should not be there, however.
So why not avoiding to use the intermediate variable @files and just do
for (<*.sql>) { # I never use C<foreach> ;-)
Why load the entire list into memory? Just use:
while (<*.sql>) { ...
# I still prefer C<for> orver C<foreach>!!
I use for for for loops (e.g. for (1..100)) and foreach for foreach loops (e.g. foreach (@array)). Using for unconditionally as you do is bad programming, since it affects the ability to read your program negatively.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: if expression
by blazar (Canon) on Sep 16, 2005 at 15:14 UTC | |
|