Your $DBH variable is a lexical in the scope of the file that your package is in. It starts out as undef, but when you set it, it will stay set. It never goes out of scope and so never loses its value.
I know that $DBH is file lexical and visiable to the MyDB package. but i think the second call to MyDB->dbh is independent to the first one and like a new instance of something.
In reply to Re^2: OO question
by Anonymous Monk
in thread OO question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |