in reply to Working with Subfolder
Variable @outLines isn't emtpied when the contents of it are written to the file. So the contents of every file are added to it, after which the complete array (including the old contents) is written to adjusted.learn. Instead of having a global @outLines array, you should declare it within the process subroutine:
Now, every time when process is called, the @outLines array is created afresh.sub process { my @outLines = (); ... }
Another option would be to insert a @outLines = () statement after writing to the adjusted.learn file.
Arjen
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Working with Subfolder
by Anonymous Monk on May 28, 2004 at 12:42 UTC |
In Section
Seekers of Perl Wisdom