my $conn = DBI->connect("dbi...); sub { my $conn = shift; ... }