in reply to file duplication error

This really has nothing to do with the problem at hand but I just wanted to add an observation.

open (fileReadWrite,"../Rules1.txt");
Always check the return value of open() and react accordingly:
open(FILEREADWRITE, "../Rules1.txt") || die "Could not open Rules1.txt + - $!\n";
You are reading the entire file into memory here:
my @dataRead = <fileReadWrite>;
Which is ok for small files but might bite you if you try that with huge files.

-- vek --