As far as I remember, \$dbh is not a scalar. It is a reference, not a scalar. If you print a reference, it doesn't know what to do so it prints out the address value, it doesn't mean it is a scalar. (Of course I may be wrong but I'm pretty sure I am not)