This is a terrible hack way to do it - but you could reduce it to one select by:
$sql='select oid,time';
$sql.='from clock';
$sql.='order by time';
$exec=$dbh->prepare($sql);
$exec=$dbh->execute()||die "Query Failed\n$sql\nError:\n$DBI::errstr";
while ($res=$exec->fetch) {
$latest_oid=${$res}[0];
}
As the last record to come off this query should be the one with the latest time stamp - $latest_oid will have the corresponding oid.
game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);