Hi,

I'm trying to use the module WWW::Search to search this site, with the backend WWW::Search::PubMed. CPAN keeps installing it in C:\Perl\site\lib when it should be in C:\Perl\site\lib\WWW\Search. When I try to run the code:

#! c:\perl\bin use WWW::Search; $query = "lung cancer treatment"; $search = new WWW::Search('PubMed'); $search->native_query(WWW::Search::escape_query($query)); $search->maximum_to_retrieve(100); my $response = $search->response(); if ($response->is_success) { print "Page returned ok"; } else { print "error: " . $response->as_string(); } while (my $result = $search->next_result()) { $url = $result->url; $title = $result->title; $desc = $result->description; print "$result\n"; print "<a href=$url>$title<br>$desc<p>\n";

I get:

Unknown search engine backend PubMed (Can't locate WWW/Search/PubMed.p +m in @INC (@INC contains: C:/Perl//lib C:/Perl/site/lib .) at (eval 5 +) line 2. BEGIN failed--compilation aborted at (eval 5) line 2. ) at C:\Perl\progs\test2.pl line 6

So I tried moving it into C:\Perl\site\lib\WWW\Search. The above script then works but gives no response other than:

Page returned ok

I'm able to search the web via WWW::Search::AltaVista so I know that the WWW::Search module installation is ok. I'm thinking this might be some sort of installation problem. Is there any way to force installation of WWW::Search::PubMed into C:\Perl\site\lib\WWW\Search? Or maybe this is some other problem?


In reply to problem with module installation by dannoura

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.