I have a real strange DBI problem. I'm using DBIx::Abstract for constructing a search function over a message board, but somehow it gives me a real strange error message:

execute called with 2 bind variables when 0 are needed

Has anyone seen this before? This is the code which I am using:

my @what = split(/\s+/, $what); shift @what if $what[0] eq ''; # skip leading empty fields my $first = 1; foreach (@what) { push (@$where, 'AND') unless $first; push (@$where, [ { subject => ['LIKE', "\%$_\%"] }, 'OR', { message => ['LIKE', "\%$_\%"] }, ]); $first = 0; } $dbx->select({ fields => 'reference, subject, name', table => 'boardmessage', where => $where, });

I can't see any mistake in here, still it gives me the above error message. In the debug I found this thing:

DBIx::Abstract::__literal_query('DBIx::Abstract=HASH(0xb92e080)', 'SEL +ECT reference, subject, name FROM boardmessage WHERE ((subject LIKE ? +) OR (message LIKE ?))', '%huhu%', '%huhu%') called at /usr/share/per +l5/DBIx/Abstract.pm line 769

This leave me even more wondering, for there are two ? in the query and two bind values, so I am really wondering where the thing is bailing out? Did I hit a strange error in the module, or am I having something wrong? Please enlighten me, I'm out of ideas here...
--
use signature; signature(" So long\nAlfie");


In reply to strange DBI problem (bind call difference) by alfie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.