Joss Shaw
2007-Oct-11 18:06 UTC
[Xapian-discuss] Argument isn't numeric in subroutine entry ? Any ideas please...
Hey all ! I'm getting a really strange thing happening in some code that once worked with an older version of Xapian < 1.0 and that now seems "broken" in 1.2.0. Basically if I do... my @my_terms = qw/query here/; my $xapian_query = Search::Xapian::Query->new(OP_OR, @my_terms); my @my_terms2 = qw/nuts beer/; my $xapian_query2 = Search::Xapian::Query->new(OP_OR, @my_terms); and then finally: my $final_query = Search::Xapian::Query(OP_AND, ($xapian_query, $xapian_query2)); It will throw an error like: Argument "Xapian::Query(((query OR here) AND (nuts OR beer)))" isn't numeric in subroutine entry at /perl/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Search/Xapian/Enquire.pm line 42. I'm sure it once worked... hopefully you guys can make out what I'm trying to achieve - any pointers warmly welcomed. Many many thanks,>joss___________________________________________________________ Yahoo! Answers - Got a question? Someone out there knows the answer. Try it now. http://uk.answers.yahoo.com/
Olly Betts
2007-Oct-11 18:46 UTC
[Xapian-discuss] Argument isn't numeric in subroutine entry ? Any ideas please...
I don't understand the error you get, but this line is wrong:> my $final_query = Search::Xapian::Query(OP_AND, ($xapian_query, $xapian_query2));That should be: my $final_query = Search::Xapian::Query->new(OP_AND, ($xapian_query, $xapian_query2)); Or just: my $final_query = Search::Xapian::Query->new(OP_AND, $xapian_query, $xapian_query2); If that's not it, can you post a complete example script? It's much harder to work with just a snippet (for a start, I've no idea what "entry" does, or which line is line 42...) Cheers, Olly