in reply to DBI not erroring out on Insert

You are using strict and warnings, aren't you? If not, that'll probably give you a headstart.

Do you know for sure that the program is skipping over the "insert line?" Have you run it under the debugger?

And you say you're offering a summary version of the code (which is the right thing to do so long as it exhibits the same problem). Does the original behave just as this does?

And, oh yes, where are you looking for the error? Are you using a config that could be rerouting <STDERR> to a file or somewhere else unexpected?

Replies are listed 'Best First'.
Re^2: DBI not erroring out on Insert
by chromatic (Archbishop) on Sep 10, 2011 at 05:16 UTC

      Given the code and the (detail-challenged) problem description, there is a (small) chance that "the summarized code I am using" is:

      1. not the actual code but instead, a summary which masks some error in OP's (presumed) actual code
        or
      2. is a fragment of the actual code.

      In case 1, the error might be revealed to OP at his/her console.

      In case 2 both cases, the fragment doesn't pass perl -c junk3.pl:

      Scalar found where operator expected at F:\_Perl_\pl_test\junk3.pl lin +e 11, near "$query" (Missing semicolon on previous line?) syntax error at F:\_Perl_\pl_test\junk3.pl line 11, near "$query " F:\_Perl_\pl_test\junk3.pl had compilation errors.

      which reveals the missing ";" just before OP's "#" at position (1 based) 82 in what I infer the OP is referring to when saying "It is just skipping over insert line like it didn't exist, "

      Sometimes, an observation or question about these pragmata is not merely boilerplate nor blind kowtowing to conventional wisdom.

      Update: s/case 2/both cases/ since the following statement is equally applicable in both cases.

        Sometimes, an observation or question about these pragmata is not merely boilerplate nor blind kowtowing to conventional wisdom.

        I agree that the example code is clearly untested and buggy (or as the OP described it, "summarized"), but the OP also wrote:

        I can't get perl to give me an error. I am purposely trying to insert data for a non-existant column. So it should kcik back with an error - but it is not.

        I believe a better suggestion is "Post your code", not "Please add these two lines to your program, because even though I haven't seen the code and MySQL isn't giving you the error you expect, they might magically solve your problem."

        Improve your skills with Modern Perl: the free book.