... none of them seem to work anymore
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
| [reply] |
#! 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...) | [reply] [d/l] |
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
| [reply] [d/l] [select] |
I'm too rushed to install the library and test it right now, but WWW::Search::Yahoo was last updated April 21, 2007. So it is unlikely to have aged into no longer working. What version are you using? The current Yahoo version is 2.409.
To check the version of your installed library you can use this one-liner:
perl -e -MWWW::Search::Yahoo -e 'print $WWW::Search::Yahoo::VERSION'
If you are on a windows system you'll need to replace the ' with ".
| [reply] [d/l] |