Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^12: WWW-Search module that works

by coder57 (Novice)
on Jun 15, 2007 at 00:25 UTC ( [id://621374]=note: print w/replies, xml ) Need Help??


in reply to Re^11: WWW-Search module that works
in thread WWW-Search module that works

so far
DB<1> n main::(ysam5a.pl:10): my $sQuery = 'Columbus Ohio sushi restaurant'; DB<1> n main::(ysam5a.pl:11): my $oSearch = new WWW::Search('AltaVista'); DB<1> x $sQuery 0 'Columbus Ohio sushi restaurant' DB<2> n main::(ysam5a.pl:13): $oSearch->native_query(WWW::Search::escape_que +ry($sQuer )); DB<2> x my $oSearch 0 undef DB<3> n main::(ysam5a.pl:14): $oSearch->login($sUser, $sPassword); DB<3> n main::(ysam5a.pl:16): while (my $oResult = $oSearch->next_result()) main::(ysam5a.pl:17): { DB<3> n main::(ysam5a.pl:20): $oSearch->logout; DB<3> x my $oResult 0 undef DB<4> n Debugged program terminated. Use q to quit or R to restart, use O inhibit_exit to avoid stopping after program termination, h q, h R or h O to get additional info.

Replies are listed 'Best First'.
Re^13: WWW-Search module that works
by menolly (Hermit) on Jun 15, 2007 at 17:45 UTC
      I have WWW::Search installed but not WWW::SearchResult I am on activeperl 5.8.6 which repository has it?
        What does the debugger show after you call new? Are you calling new with Yahoo, or with another search engine? If it's another engine, do you have the specific WWW::Search backend for that engine installed?
Re^13: WWW-Search module that works
by quester (Vicar) on Jun 17, 2007 at 06:02 UTC
    When you say "x my $oResult" it means to create a NEW variable, local to just that one debugging command, and display its value, which is of course undefined. If you just say "x $oResult" it will display the correct value.
    Incidentally, I just ran your program under perl 5.8.8 on a Linux box, installing WWW::Search::AltaVista (and Yahoo as well) from CPAN. It works fine for me. You might have run into a Windows (or ActivePerl) compatibility issue. Sometimes it helps to use the version of Perl that runs under Cygwin .

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://621374]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-04-17 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found