in reply to Re^3: Not sure how to handle this scope (updated)
in thread Not sure how to handle this scope
Maybe give the inner variable a different name and assign it the value from the "main" handle in the non-fork case?
my $main_dbh = DBI->connect(...); while( 1 ) { my $dbh; if( $forked ) { $dbh = DBI->connect(...); } else { $dbh = $main_dbh; }; $dbh->selectall_arrayref($sql); }
|
---|
In Section
Seekers of Perl Wisdom