in reply to Re: Re: Deleting a record from a flat text file
in thread Deleting a record from a flat text file

You have commented out the first call to open which means the mybase.txt is not being read. Then you clobber the file with your second open.

Couple of things I'd point out. Always, always, always, check the return value of open, you'll save yourself a lot of grief:

open(DATABASE, "mybase.txt") || die "open mybase.txt - $!\n";
Try not to use chop to remove newlines, use chomp instead. chop will remove (and return) the last character in the string regardless of whether it's a newline or not.

-- vek --