in reply to WWW-Search module that works

Can you define exactly what module functionality "doesn't work anymore"? What are you trying to do? How do the results differ from your expectations?

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

Replies are listed 'Best First'.
Re^2: WWW-Search module that works
by coder57 (Novice) on Jun 12, 2007 at 10:17 UTC
    i.e
    #! usr/bin/perl use strict; use warnings; use WWW::Search; my $oSearch = new WWW::Search('Yahoo::UK'); my $sQuery = WWW::Search::escape_query("spiderman 3 news"); $oSearch->native_query($sQuery); while ( my $oResult = $oSearch->next_result() ) { print "Adding: ", $oResult->url, "\n"; } print ref($oSearch);
    Shows nothing (the same with replacing Yahoo::UK with Altavista/Msn/Alltheweb...)

      OK .. now we're getting somewhere. You've provided some code (great) and told me it outputs nothing.

      My tendency, whenever I create an object, is to make sure that the object is defined. So, in your example, I would check that $oSearch is defined after it's created, and die if not.

      After that, I'd step through the program using the Perl debugger, and find out what's happening. Dump $sQuery and make sure it has something useful in it, and likewise, see what $oResult has.

      Also, your shebang line is wrong. It should probably be

      #!/usr/bin/perl -w
      Try that out and let us know how it goes for you.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        I am using activeperl 5.86 so the she bang doesn't matter. The code is per the www-search-yahoo module. I have tried it with many search terms and each show nothing. I have updated to the most current version of www-search for each search engine listed, and the results are still the same where it is meant to print urls, it simply states for example WWW::Search::Yahoo repeatedly
          A reply falls below the community's threshold of quality. You may see it by logging in.