DaWolf has asked for the wisdom of the Perl Monks concerning the following question:
Well the problem here - as the experienced brothers probably already seen - it's that $se is not parsed, so it trys to run literally $search = new WWW::Search('$se'), instead of $search = new WWW::Search('AltaVista'), for an example.#!/usr/bin/perl -w require WWW::Search; while ($term = <>) { chomp $term; @se = ('AltaVista, Excite, Infoseek, Lycos'); foreach $se (@se) { $search = new WWW::Search('$se'); $search->native_query(WWW::Search::escape_query($term)); print "\n\nResults from $se :\n\n"; while ($result = $search->next_result()) { print $result->url, "\n"; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Making a WWW::Search loop
by gav^ (Curate) on May 07, 2002 at 21:11 UTC | |
|
Re: Making a WWW::Search loop
by Kanji (Parson) on May 07, 2002 at 21:13 UTC | |
|
Re: Making a WWW::Search loop
by particle (Vicar) on May 07, 2002 at 21:10 UTC |