Actually, your code closes the $dbh before you ever execute the query! Where as the our version doesn't. With the our version, the user can use $dbh in other functions, because $dbh is a global.
I'm not saying our is required to do this -- it isn't -- I'm just saying you broke the program by blindly switching to my.
In reply to Re^5: Use of 'our' considered harmful
by ikegami
in thread Use of 'our' considered harmful
by DrHyde
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |