When I print $data_pair->{'key'} gives me all the keys present in the array
When I print $data_pair->{'values'} gives me all the values for the keys
Your data structure is strange :-)
I think you need something like this:
my ($cor, $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}; } } $sql_content .= qq( INSERT IGNORE INTO correct SET text="$cor", date="$date");
But as others have already mentioned, using DBI placeholders makes far more sense here.
In reply to Re^3: If condition
by davorg
in thread If condition
by gem555
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |