my $sth = $cached{ $sql }; unless ($sth) { $sth = $dbh->prepare($sql); # ggfs. $sth->finish } $cached{ $sql } = $sth;