in reply to Re: Need help! Data in file getting deleted
in thread Need help! Data in file getting deleted

Right on
You should use  >> instead.

 open (FILE, ">>$filename") or die "$!";

Entities should not be multiplied unnecessarily.

Replies are listed 'Best First'.
Re: Re: Re: Need help! Data in file getting deleted
by mr_evans2u (Novice) on Nov 19, 2003 at 17:25 UTC
    If I do the

    open (FILE, ">>$filename") or die "$!";

    I have two sets of the data in my file. I only want one. It works fine as long as the user doesn't try to delete a duplicate. The duplicate is causing my issues.

      So you then you'll have to test to find out if the file is empty or not before running this. Are you asking how to do that, or where?

      the data is there up to the point where the interface removes the file-lock. If I remove the file-lock by the command line the data is still there. Or if I try to access the page again via the interface and then have the interface delete the lock it's fine.