Thanks both of guys for your help and concern!
i am using the same .dat file for storing the data for every files which i want to edit.
--------------------
open(DATAF,"<$filename4") || die "Can't Open $filename4: $!\n";
$serial_no = <DATAF>;
close(DATAF);
if ($serial_no ne "")
{
$serial_no = "";
}
open(DATAF,">$filename4") || die "Can't Open $filename4: $!\n";
print DATAF ($serial_no);
close(DATAF);
#### write the new entry
#-----------------------
open(DATAF,">$filename4") or die "Can't Open $filename4: $!\n";
print DATAF ($subject);
close(DATAF);
}
-----------------------------------
so that first i clean up the old code and them right down the current changes into the file. i don't take a back of the older file. but now i will do.
but after Millennium's question its strick me, and i have test with following and find this is working perfectly without cleaning the older data.
------------------
#### write the new entry
#-----------------------
open(DATAF,">$filename4") or die "Can't Open $filename4: $!\n";
print DATAF ($subject);
close(DATAF);
}
-------------------
its solve the purpose.
and regarding
@lines = <TEMP>;
chomp(@lines);
i am still observing the things is working perfectly or not. its take some days to find out.
should use this also, because i am writing this variable into the .dat file and save it.
chomp($subject);
should i use this also??? please tell me.
one more thing i have found that, it store the whole code into center of the file, i realize that when i open the file on editor. find each and everyline is on the center alinged, which is generally on left side on the editor, when we start code or edit code.
can any one of you tell me why is this happening?
Thanks guys.
