});
my $dbh = $schema->storage->dbh;
- my $sg = Scope::Guard->new(\&cleanup);
+ my $sg = Scope::Guard->new(sub { cleanup($schema) });
eval { $dbh->do(q[DROP TABLE "artist"]) };
$dbh->do(<<EOF);
# clean up our mess
sub cleanup {
+ my $schema = shift;
+
my $dbh;
eval {
$schema->storage->disconnect; # to avoid object FOO is in use errors