Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
June 29, 2005, 6:06 pm
rate this thread
Maybe someone knows why the Google API is having problems when the '&'
char appears in a query. This is necessary when trying to find out
info about a URL as the code below demonstrates.
my $query =
my $google_search = SOAP::Lite->service("file:GoogleSearch.wsdl");
my $results = $google_search ->
$google_key, $query, 0, 10, "false", "", "false",
"", "latin1", "latin1");
@} or exit;
The last line causes this run-time error:
Can't use an undefined value as an ARRAY reference at ...
Any ideas how this problem can be fixed? I tried replacing the & with
%26 but then Google can't find the site.
Re: Google API using SOAP Lite doesn't like '&' in query
I think I found the problem. Since this is being converted into a SOAP
query (XML), the '&' char must be converted in '&'. The & is
then converted back into a '&' char when performing the actual query.
This also applied to using the Net::Google module. An automatic
conversion of these chars would be nice to have done.