my $sql = "SELECT script FROM scripts where name=?"; my $sth = $dbh->prepare($sql); $sth->execute($ref->{name});