in reply to file duplication error
You're really going through a lot of trouble to copy the contents of an array, where a simple
would do.@dataWrite = @dataRead;
Nowhere do you actually look at what @dataRead contains, after you modify @dataWrite. How would you know it changed? It didn't, I'm sure.
Oh, and this:
is a recipe for disaster: first you open the file for writing, clearing it in the process, and then you try to lock it. Too late. You can try replacing ">" with ">>", and addopen(fileOUT,">../Rules1.txt") or dienice("Can't open counter.txt: $!" +);; flock(fileOUT,2); seek(fileOUT,0,0);
at the bottom. It might work, it surely would on some platforms.truncate fileOUT, 0;
|
|---|