|XP is just a number|
RE: my and its useby autark (Friar)
|on Nov 16, 2000 at 00:14 UTC||Need Help??|
| Can someone tell me where I am wrong in thinking that I can
| do my $dbh = DBI->connect($db, $user, $auth); ?
There is nothing wrong with your connect statement. However, in your code you are using the $dbh variable before it is properly defined.
Here you use the $dbh handle in the 'else' part of your statement. Think of it as this:
So if the first part fails, it tries the second part, which happens to use the $dbh variable which failed to be defined because the connect call failed.
In this case I would put the 'my $dbh' part as a separate stament above the connect statment.