Re: Seeking help with a Perl module for translating languages

  • From: "Octavian Rasnita" <orasnita@xxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Wed, 15 Oct 2008 11:11:55 +0300

The POD documentation of this module isn't very good written. Instead of 

 lp => param(en_de),

it should say

 lp => 'en_de',

and it's your job to get that value from wherever you want.

But this is not the main problem. I've tried to run the program but it gaves 
the following error in WWW::Search, so I think it doesn't work very well.

"Use of uninitialized value in pattern match (m//) at 
D:/perl510/site/lib/WWW/Search.pm line 1291."

Octavian

----- Original Message ----- 
From: "Jamal Mazrui" <empower@xxxxxxxxx>
To: <ProgrammingBlind@xxxxxxxxxxxxx>
Sent: Wednesday, October 15, 2008 12:23 AM
Subject: Seeking help with a Perl module for translating languages


> With Perl 5.8, I am trying to use the module WWW::Search::Translator,
> which programmatically translates text between different natural languages
> using babel.altavista.com.
> 
> When I run the sample code in the documentation, I get an error about a
> missing param function.  After web searches, I found that the CGI module
> includes a function by that name, but using that module as well produced
> another error message instead.
> 
> Can anyone help?  Below is the error message, followed by the code.
> 
> Jamal
> 
> Undefined subroutine &main::param called at TranLang.pl line 2.
> 
> 
>  use WWW::Search;
>  %opts = (
>  lp => param(en_de),
>  );
>   $query = "a whole bunch of english text to be translated to german";
>   my $search = new WWW::Search('Translator');
>   $search->native_query(WWW::Search::escape_query($query),\%opts);
>  while (my $result = $search->next_result())
>    {
>    $p = $result->raw;
>    print "$p";
>    }
> 
> 
> __________
> View the list's information and change your settings at 
> //www.freelists.org/list/programmingblind
>
__________
View the list's information and change your settings at
//www.freelists.org/list/programmingblind

Other related posts: