This module is used by creating a subclass, which should override the
expand method, which takes care of searching for the autocompletion results.
Run the whole autocompletion process in one fell swoop. Prints everything to standard output, including the HTTP headers. The arguments %args are passed to the constructor.
cgi, which should provide a CGI or CGI-compatible object. If none is provided, a new CGI object is created by default.
Returns the string to be expanded (which usually comes from the "qu" CGI parameter).
Returns the CGI object being used.
Get a CGI parameter. Just delegates the call to $self->cgi.
Return the HTTP headers. It just delegates to $self->cgi, but it uses the UTF-8 encoding by default.
Provide the autocompleted values for the query. Returns a 4-element list: ($query, $names, $values, $prefix). $query is the query as returned to the frontend script (typically converted to lowercase). $names is an array ref of results. $values is an array ref of values that are usually shown on the right-hand side of the drop-down box in the front end; it is used by Google for the estimated result count. The purpose of $prefix is not certain at this time, but it appears that if the array is empty, the drop-down menu appears but the word in the input box itself is not completed, while if the array is not empty (for example, contains an empty string as its only element), the word in the input box is completed as well.
print $obj->as_array(["a", "b", "c"]); # prints 'new Array("a", "b", "c")'
Returns that message that is returned by the Google backend when the
js CGI parameter is not true.
Ivan Tubert-Brohman <email@example.com>
Copyright (c) 2004 Ivan Tubert-Brohman. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.