$sybase_drh->{Callbacks} = { selectrow_array => sub { # Protect against recursion when calling overriden method. return if $in_callback; local $in_callback = 1; my ($drh, $sql, $attrs, @bind_values) = @_; # Do something to $sql, $attrs and/or @bind_values here... # Tell DBI not to call original connect method undef $_; return $drh->selectrow_array($sql, $attrs, @bind_values); }, };