in reply to escape characters for dbi

You could try:
my $name = $dbh->quote("O'Brien"); $sth = $dbh->prepare("SELECT SUM(number) FROM $serverTable where name = $name);

--twerq UPDATED -- merlyn: why does that work? Does using placeholder auto-quote for you?