in reply to Re^2: Deletes All Records not just one
in thread Deletes All Records not just one

Try:

print $out_file_handle $line_from_file, "\n";

You're currently printing out the variable $_ which isn't being defined by any of the code you posted (but is being defined somewhere else to point to an object of some kind).

package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name