in reply to Feedback Appreciated on text-parsing, SQL querying subroutine

The $dbh->prepare is in a loop, with the same statement and handle attributes. You only need to prepare it once:
my $sth2 = $dbh->prepare_cached("select d_id, c_id from d where d_id = ?"); $sth2->execute( $did2 ); # And since you need less clutter on the monitor (my $sth2 = $dbh->prepare_cached(<<"")) -> execute ($did2); select d_id, c_id from d where d_id = ? # line above intentionally left blank

Replies are listed 'Best First'.
Re^2: Feedback Appreciated on text-parsing, SQL querying subroutine
by saberworks (Curate) on May 31, 2006 at 19:29 UTC
    Actually, he's not using placeholders so in his case, he will have to put the prepare in the loop. Once he switches to placeholders, then preparing it once at the beginning would be much better.

    Also, your HEREDOC terminated with an empty line and a mandatory comment (otherwise, it will get broken over and over) seems a lot less clear and more cluttered than your first example.