in reply to Using objects in exported functions
But, if you really want, you could put package main; our $dbh; before the package Exported line; then simply $dbh will refer to the one in main.
Or, at some miniscule risk of perl later trying to use the same name for some internal purpose, you could use a "punctuation variable" like ${^Dbh}. Such variables are always looked for in package main.
|
---|