|Pathologically Eclectic Rubbish Lister|
DBI fails to return an error codeby djten (Novice)
|on Oct 04, 2011 at 18:51 UTC||Need Help??|
djten has asked for the
wisdom of the Perl Monks concerning the following question:
This one has got me scratching my head. It involves running some Perl code on two computers. One is my desktop computer, running Windows 7 Professional SP1, everything up to date. The other is my laptop computer, running Vista Home Premium SP2, everything up to date.
Everything else is the same - I purposely made it so. I set them both up at the same time, in the same way, because I wanted to have as close to identical development environments as possible between working in my office and going on the road. ActiveState Perl v5.12.4, Apache v2.2.17, MySQL v5.5.8, Perl DBI v1.616, and all configuration settings identical on both computers.
Yesterday I generated an error on my desktop computer in a project I am working on. I had changed a column name in a table, but forgot to update the references to that column in my code. So executing the code generated an error. I have code to display any database access errors, relying on $DBI::err and $DBI::errstr. In this case the error was of course "unknown column."
What I noticed was, when I use my laptop to run the same code on the identically structured table (that still had the column name discrepancy), I got the same error, but where my same error-catching code trys to display the contents of $DBI::err and $DBI::errstr, I get nothing. An empty string, I guess. The error is definitely generated, but $DBI::err and $DBI::errstr are empty. Only on my laptop, with all the same versions of everything.
I have an identical copy of all the projects I am working on or maintaining on both computers. So on my desktop I go to a different project, put an error into some database access code, and purposelly generate an error. The err and errstr values show up. Then I make the same purposeful error in the same project on my laptop, and err and errstr are still blank. So it's not specific to one project - I would guess that it is system-wide in some way. But what, where, how?
At this point someone will certainly wonder, when did you start noticing this happening on the laptop? Did you install something new on that laptop recently? Well, I just installed both machines last week (identical everyting, as I described above), and this is the first time I have had a database error come up in coding since then. I did not install anything new or different on the laptop.
Can any of the Perl Monks think of a situation that would cause this? Because I am currently stumped.