It will make more sense if you move assignment to $sql_content out of loop.
You probably want something like
my $cor ;
my $date ;
for my $data_pair (@data_list) {
if($data_pair->{'key'} eq 'correct'){
$cor= $data_pair->{'value'};
}
if($data_pair->{'key'} eq 'date'){
$date= $data_pair->{'value'};
}
}
my $sql_content = "INSERT IGNORE INTO correct SET text='".$cor."' date
+='" .$date."'";
If this is what we are looking for than try this as well
my %data_hash = map {$_->{'key'} => $_->{'value'} if ($_->{'key'} eq '
+correct' || $_->{'key'} eq 'date')} @data_list;
my $sql_content = "\nINSERT IGNORE INTO correct SET text='".$data_hash
+{'correct'}."' date='" .$data_hash{'date'}."'";