Hello All, I am using Perl 5.8.0 but this file for our Intranet Web server was created using 5.0, below is the file where I am using chomp function to chomp the contents after reading the PurchaseRequestDataFile,
sysopen (PURDBFILE, $PurchaseRequestDataFile, O_RDWR|O_CREAT) or HTMLdie ("<br>Unable to open Database File\n</html>"); flock(PURDBFILE, LOCK_EX); my $Header = <PURDBFILE>; chomp ($Header); if (not ($Header eq "PR#FMOARGMI%C")){ print @PreHTML; print $Error; print '<br>The data base file format is not valid!!<br> Report this error to <a href="mailto:[EMAIL PROTECTED]">Administrator</a>'; print "</html>"; exit (1); } my $RecordCount = <PURDBFILE>; chomp ($RecordCount); $RecordCount =~ s/\#//mg; $RecordCount =~ s/\*//mg; seek(PURDBFILE, 0, 0) or HTMLdie $!; $RecordCount++; $RecordCountLine = '###**###'.$RecordCount.'***##***'."\n"; my $Header = <PURDBFILE>; print PURDBFILE $RecordCountLine; The problem is the PurchaseRequestDataFile is not getting chomped but new contents are getting appended to the file, hence my record count variable remains the same, i.e. it keeps incrementing the old no. only. How do I solve this problem TIA Manjunath DISCLAIMER: This e-mail and any attachment (s) is for authorised use by the intended recipient (s) only. It may contain proprietary material, confidential information and/or be subject to the legal privilege of iWave Systems Technologies Private Limited. If you have received this message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from retaining, using, copying, alerting or disclosing the content of this message. Thank you for your co-operation. _______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs