Your assumption that a file using your module would want to import a single variable based on some database name that may or may not be created somewhere else is probably in error. How do you know which handle should be exported? And if the calling code must call connect() to specify it, what's the point?