Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Working with Subfolder

by Aragorn (Curate)
on May 28, 2004 at 12:35 UTC ( #357202=note: print w/replies, xml ) Need Help??


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:
sub process { my @outLines = (); ... }
Now, every time when process is called, the @outLines array is created afresh.

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
    seems to have done the job nicely, thanks!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://357202]
help
Chatterbox?
[Corion]: A good daypart!
Corion feels slightly bad for initiating a discussion yesterday and then running away. I guess I should write that up as a meditation or SoPW
[Corion]: Not the "running away" part but the question+ discussion about IO-less HTTP modules
[Corion]: (or how/where to patch AnyEvent::HTTP or LWP::UserAgent to take control of both the callstack and the data transfer)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2016-12-08 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (137 votes). Check out past polls.