good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Why Does My Class::DBI Program Break Under "use diagnostics" Pragma?by Wally Hartshorn (Hermit) |
on Jul 11, 2003 at 20:03 UTC ( [id://273553]=perlquestion: print w/replies, xml ) | Need Help?? |
Wally Hartshorn has asked for the wisdom of the Perl Monks concerning the following question: Okay, this is bizarre. In one particular program (which uses Class::DBI), when I "use diagnostics", the program fails to compile, complaining that it cannot find "DBI/db.pm". If I "use warnings" instead, the program compiles fine and runs perfectly. Consider the following code (stripped of all useful statements), which you can use on your system to determine whether you get the same behavior: mydemo.pl
MyTable.pm
MyDatabase.pm
When I try to run "mydemo.pl" with "use diagnostics", I get a boatload of errors about being unable to load "DBI/db.pm". Here's a few lines from the start:
It goes on and on like that. Just change "diagnostics" to "warnings" and the problems go away (not to mention that, with the actual code in place, the program works). What kind of weirdness have I stumbled across? Has anyone else seen something like this? (I spent about 5 hours trying to figure out why one program was working while a similar program -- use had the "use diagnostics" line -- was not!) This is Perl 5.6.1 under Sun Solaris 7. Wally Hartshorn
Back to
Seekers of Perl Wisdom
|
|