Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^4: Not sure how to handle this scope (updated)

by Corion (Patriarch)
on Aug 18, 2021 at 18:44 UTC ( #11135937=note: print w/replies, xml ) Need Help??


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); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135937]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2022-01-19 18:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?