I got thrown off track by the same thing as
dws initially, but I think the reason that the error messages differ is that the script never reaches the programmer's die, but it dies in DBI.pm because RaiseError is set. That said, try printing out $password in the second script to see that it actually contains what you expect it to contain.
CU
Robartes-