in reply to Deleting a record from a flat text file

The Tie::File module will do exactly what you want. The only thing that I would draw your special attention to is the flock method, which you'll need to call in order lock the file.
my @a; my $o = tie @a, "Tie::File", $filename; $o->flock; # find and delete the first record with the given key val for my $i ( 0 .. $#a ) { my( $id2, $status, $fromemail, $eform ) = split /\|/, $a[$i]; if ( $id2 eq $id_to_remove ) { splice @a, $i, 1; last; } }

jdporter
The 6th Rule of Perl Club is -- There is no Rule #6.