Is this a dictionary service or a Google search service? Because what it's doing is getting a Google search results page. Shouldn't it be getting a page from a dictionary site? Because that way it could actually tell you the definition over MSN and not have to send you a "Click here to go to a site with the definition for $msg".
I'll help you out a little by showing some code I have for using dictionary.com to get a definition:
Code:
sub define {<br /> my ($self,$client,$msg) = @_;<br /><br /> # If there's a message to define...<br /> if (length $msg > 0) {<br /> my $src = LWP::Simple::get "http://dictionary.reference.com/search?q=$msg" or return "Could not get dictionary!";<br /> $src =~ s/\n/ /g;<br /><br /> # Get the first definition.<br /> if ($src =~ /<OL><LI>(.*?)<\/LI>/i) {<br /> my $def = $1;<br /><br /> return "Dictionary.com defines $msg as:\n\n"<br /> . "1. $def";<br /> }<br /> else {<br /> return "Could not obtain the definition to $msg!";<br /> }<br /> }<br /> else {<br /> return "Please provide a message when calling this command.";<br /> }<br />}
Think i forgot to CHMOD the modules. [right][snapback]47197[/snapback][/right]
Hm, I've never had to CHMOD modules (my site engine uses Mail::Sendmail for e-mail sending, I just uploaded it to its local lib and it runs fine). _________________ Current Site (2008) http://www.cuvou.com/
It is a dictionary service, quite good, (some people may have used an old plazma service, this is it, the original went down). Thanks to Mat007 for basic code!
a member of the genus Canis (probably descended from the common wolf) that has been domesticated by man since prehistoric times; occurs in many breeds; "the dog barked all night"