in reply to Deletes All Records not just one
Maybe you should do ...
... instead of ...print DAT "$_\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.print ("$_\n");
In Section
Seekers of Perl Wisdom