in reply to Deleting a record from a flat text 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.
|
|---|