#!/usr/bin/perl #************* File Header ******************************
Well written code should be mostly self documented. Have you considered pods instead? (Note: this is only a minor point!)
use CGI qw/:standard/; my @dataWrite; my @dataRead; my $x;
Also
my (@dataWrite, @dataRead, $x);
undef @dataWrite; undef @dataRead;
Really no need for these!
open (fileReadWrite,"../Rules1.txt"); my @dataRead = <fileReadWrite>;
Ouch! Didn't you get told to always (yes, always!) check the return value of open()'s?!?

Also, nowadays it's generally recommended to use lexical FHs and the three-args form of open(). Hence

open $fileReadWrite, '<', '../Rules1.txt' or die $!;
But are you sure it's "ReadWrite"? (I'm contending that it's not an especially well chosen name...)
foreach my $value1 (@dataRead) { push @dataWrite , $value1; }
Ouch!
@dataWrite=@dataRead;
push @dataWrite, "Code1\n";
So this is really all you wanted to do... hint: '>>'.
open(fileOUT,">../Rules1.txt") or dienice("Can't open counter.txt: $!");;
Ditto as above wrt open().

What is dienice()? It's sensible to post minimal, but still working examples!

print "Content-type: text/html\n"; print("\n");
Don't! There's no point in reinventing the wheel and risking to do it wrong, but possibly for educational purposes. So since you're using CGI.pm in the first place let it do it for you!

In reply to Re: file duplication error by blazar
in thread file duplication error by Roy.Amitabh

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.