in reply to Re^4: s/// not replacing data
in thread s/// not replacing data

You could put your execute and bind statements inside the foreach loop, which would cause the query to be executed for each line in @keep.

Or you could assemble an array outside the foreach loop something like:

my @emoticons; push @emoticons, [$id, $name, $location, $face] while $sth->fetch;
Then inside your foreach, instead of the while/fetch, you'd have something like:
foreach my $emote_aref (@emoticons) { ($id, $name, $location, $face) = @$emote_aref; ...

Caution: Contents may have been coded under pressure.