lt007 has asked for the wisdom of the Perl Monks concerning the following question:
Hey, I've got some problems with a little program. I want to write into 2 files but the ouput-structure differs inside those two.
I use this code:for ($i=1;$i<=$max;$i++){ $pwd = &randomPwd($nmbchars); select (DB); print qq("$dept$w$i","7 days","$pwd",,,,,,\n); close(DB); select (newDB); print qq("$dept$w$i"\t>\t"$pwd"\n); close(newDB); }
The loop just runs 1 time and then the program stops. It should run multiple times.
Is there a restriction in opening and closing files inside a loop?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Opening and closing files in loop
by BrowserUk (Patriarch) on Oct 22, 2012 at 08:30 UTC | |
by lt007 (Initiate) on Oct 22, 2012 at 08:42 UTC | |
Re: Opening and closing files in loop
by Corion (Patriarch) on Oct 22, 2012 at 08:33 UTC | |
Re: Opening and closing files in loop
by kcott (Archbishop) on Oct 22, 2012 at 08:49 UTC |
Back to
Seekers of Perl Wisdom