in reply to
Re^5: Can DBI modify queries on the fly?
in thread Can DBI modify queries on the fly?
The callback functionality that perrin referred to does not override the method. Instead, I can insert a callback that is called before the real method. The callback is not allowed to return any value (doing so causes an exception).
The only way to modify the behavior of the original method is to change the parameters that it gets. To do that, I have to change (the contents of) @_. The side effect is that the original method's caller has its data changed also. The other problem I see is that I won't be allowed to do this at all if the parameter I'm interested in (the query) is a read-only value as in:
my ($count) = $dbh->selectrow_array( 'SELECT count(*) FROM table' );
Both of those are serious enough to make me want to go back to looking at some DBD subclass with an overridden method instead of using the callback, but I'm not sure it will be worth the effort.