in reply to Re^2: Perl DBI: Overloading statement handle
in thread Perl DBI: Overloading statement handle
sherab, your terminology seems fine - I think you just misread my post. I wrote: "... is in a subclass ..." not "... is a subclass ...".
You have thrown me a bit with "I see I can't edit/delete the above. ...". I'm not sure if you're referring to the examlpe moritz provided or the one I linked to in the DBI documentation.
Anyway, the basic idea is that you do not re-code the one million my $sth = $dbh->prepare(...) lines you currently have; nor do you re-code any existing $dbh = new_dbh(...) lines. Instead, you make a single change to your new_dbh routine which I envisage to be as simple as:
# Old: # return $dbh; # New: return bless $dbh, 'My::DBI::st';
Then add the code provided by moritz above that.
Hopefully, that answers some of your questions. If you have more, feel free to ask.
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl DBI: Overloading statement handle
by sherab (Scribe) on Nov 09, 2010 at 14:38 UTC |