in reply to Re: DBI not erroring out on Insert
in thread DBI not erroring out on Insert

You are using strict and warnings, aren't you?

How would that help?

Replies are listed 'Best First'.
Re^3: DBI not erroring out on Insert
by ww (Archbishop) on Sep 10, 2011 at 10:19 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.