#! 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.
In reply to Re^2: if expression
by ikegami
in thread if expression
by Win
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |