NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
call me crazy, but... (Score:1)
It seems to me that you could get around this with a blessed closure that would hold onto the dbh. An autoload method would dereference the closure, and pass it the method name you wanted (to call against the dbh), and any arguments you need to pass it. And the closure would then be something like:
sub {my ($method, @args) = @_;
local $dbh->{RaiseError} = 0;
local $dbh->{AutoCommit} = 1;
return $dbh->$method( @args );
}
Does that sound like it would work?
Reply to This