We can always make it on-topic:

#!/usr/bin/perl -w
use strict;
use WWW::Search;
use LWP::Simple;
use HTML::TreeBuilder;
use Mail::Send;

my $PAIN = 10;
my $luser = shift;
my $search = WWW::Search(<<insert favorite search agent>>)->new;
my $query = WWW::Search::escape_query("@ARGV");
$search->native_query($query);
while (my $res = $search->next_result()) {
   my $html = get($res->url) or next;
   my $msg = Mail::Send->new;
   $msg->subject("Answer to your question");
   $msg->to($luser);
   my $fh = $msg->open;
   print $fh "You could have gotten this yourself with <<favorite search 
agent>>\n";
   print $fh HTML::TreeBuilder->new->parse($html)->as_text;
   close $fh;
   last unless $PAIN--;
}


:-)
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to