perldoc > WWW::SearchResult

📛 NAME

WWW::SearchResult - class for results returned from WWW::Search

🚀 Quick Reference

Use CaseCommandDescription
Create a new result object$result = new WWW::SearchResult();Instantiate an empty result object.
Get the primary URL$result->url()Returns the first URL as a string.
Get all URLs$result->urls()Returns an array reference of all URLs.
Add a URL to the list$result->add_url($url)Appends a URL to the internal list.
Get the result title$result->title()Returns the title string.
Get the description$result->description()Returns a brief description.
Get raw HTML$result->raw()Returns the raw HTML for this entry.
Get normalized score$result->normalized_score()Returns a score between 0 and 1000 (higher is better).
Convert to HTML$result->as_HTML()Returns an HTML-formatted string of the result.

📝 SYNOPSIS

require WWW::Search;
require WWW::SearchResult;
$search = new WWW::Search;
$search->native_query(WWW::Search::escape_query($query));
# Get first result:
$result = $search->next_result();

📖 DESCRIPTION

A framework for returning the results of "WWW::Search".

✅ REQUIRED RESULTS

The particular fields returned in a result are backend- (search engine-) dependent. However, all search engines are required to return a url and title. (This list may grow in the future.)

🛠️ METHODS AND FUNCTIONS

🆕 new

To create a new WWW::SearchResult, call

$result = new WWW::SearchResult();

🔗 url

Returns the primary URL. Note that there may be a list of urls, see also methods urls and add_url. Nothing special is guaranteed about the primary URL other than that it is the first one returned by the back end.

Every result is required to have at least one URL.

➕ add_url

Add a URL to the list.

📋 urls

Return a reference to the list of urls. There is also a primary URL (url).

🔗 add_related_url

Add a URL to the related_url list.

🔗 related_urls

Return a reference to the list of related urls.

📝 add_related_title

Add a title to the list or related titles.

📋 related_titles

Return a reference to the list of related titles.

🏷️ title, description, score, change_date, index_date, size, raw

Set or get attributes of the result.

None of these attributes is guaranteed to be provided by a given backend. If an attribute is not provided its method will return undef.

Typical contents of these attributes:

🔍 source

Source is either the base url for this result (as listed on the search engine's results page) or another copy of the full url path of the result. It might also indicate the source site name or address whence the result came. This value is backend-specific; in fact very few backends set this value.

➕ add_sources

Same meaning as source above, for adding sources in case there are potentially multiple sources.

📋 sources

Returns a reference to the list of sources.

📊 normalized_score

This is intended to be a backend-independent score of the search result. The range of this score is between 0 and 1000. Higher values indicate better quality results. This is not really implemented since no one has created an backend-independent ranking algorithm.

🌐 as_HTML

Convert the search result to a human-readable form, decorated with HTML for pretty-printing.

🗂️ Others

More attributes of the result. Backend-specific. Refer to the documentation of each backend for details.

🔗 SEE ALSO

WWW::Search

✍️ AUTHOR

WWW::SearchResult was written by John Heidemann. WWW::SearchResult is maintained by Martin Thurn.

WWW::SearchResult
📛 NAME 🚀 Quick Reference 📝 SYNOPSIS 📖 DESCRIPTION ✅ REQUIRED RESULTS 🛠️ METHODS AND FUNCTIONS
🆕 new 🔗 url ➕ add_url 📋 urls 🔗 add_related_url 🔗 related_urls 📝 add_related_title 📋 related_titles 🏷️ title, description, score, change_date, index_date, size, raw 🔍 source ➕ add_sources 📋 sources 📊 normalized_score 🌐 as_HTML 🗂️ Others
🔗 SEE ALSO ✍️ AUTHOR

Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 05:19 @216.73.216.114
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^