http://www.perlmonks.org?node_id=1019014


in reply to Deletes All Records not just one

Maybe you should do ...
print DAT "$_\n";
... instead of ...
print ("$_\n");
You might also might want to learn about yaml or sqlite. Dealing flatfile databases is just a pain, especially when there are better tools.