in reply to use strict and begin

What exactly is the problem?
my $dbh; BEGIN {$dbh = DBI -> connect (...)} ... $dbh -> prepare (...);
will work fine.

But why are you using a BEGIN block to set up the database connection? Why not just

my $dbh = DBI -> connect (...);
And if you really want to place it inside a block, I suggest using an INIT block.

Abigail