Hey Guys, I am having a small problem in my log files. when executed I get the error "Use of uninitialized value $DBI::errstr in concatination (.)....
It it possible to pre initialize the $DBI::errstr value to avoid the errors in my logfile?
Cheers,
Ton
DrDoc
4:36 pm on Jul 24, 2013 (gmt 0)
Or, don't concatenate it if it doesn't exist or is undefined ...
parrot
4:45 pm on Jul 24, 2013 (gmt 0)
Hey there, here is an example of the code.
if (($ErrNum eq "0") and ($NewMember eq "1")){ $CartContent = 0; $Dbh = DBI->connect($DbConnectionInfo,$DbUserid,$DbPasswd); $Sth = $Dbh->prepare("SELECT ArtikelCode FROM $DbCarts WHERE Login = '$Login#$Wachtwoord'"); $Sth->execute or $ErrNum = "3003"; $ErrMess = " ### Kritieke systeemfout! ### Program: '$PrgName' - Err: $ErrNum ### $DBI::errstr"; while (($ArtikelCode) = $Sth->fetchrow_array){ if ($ArtikelCode ne ""){ $ErrNum = "3004"; $ErrMess = " ### Kritieke systeemfout! ### Program: '$PrgName' - Err: $ErrNum ### Login of password zijn al in gebruik! ### Ga terug en kies een andere combinatie!"; } } $Sth->finish(); $Dbh->disconnect; }
DrDoc
5:43 pm on Jul 24, 2013 (gmt 0)
Exactly. You are concatenating the string whether it exists/is defined or not.