Ace::B...chSubs(3pm)
π Ace::Browser::SearchSubs β the manual page, bestie edition β¨
okay so you found the man page for Ace::Browser::SearchSubs(3pm) β that's the Perl doc you're holding, and it's literally the toolkit for writing search scripts in AceBrowser. The (3pm) just means "perl module, section 3, we're fancy like that". Let's go π¦
β¨ NAME β¨
Ace::Browser::SearchSubs β subroutines for AceBrowser search scripts. That's the whole vibe. It's the plug-in that makes your search pages pop off π
πΈ SYNOPSIS πΈ
Here's the little taste test, verbatim, no notes:
use Ace;
use Ace::Browser::AceSubs;
use Ace::Browser::SearchSubs;
use CGI qw(:standard);
my $form = p(start_form,
textfield(-name=>'query'),
end_form);
AceSearchTable('Search for stuff',$form);
...
my $query = param('query');
my $offset = AceSearchOffset;
my ($objects,$count) = do_search($query,$offset);
AceResultsTable($objects,$count,$offset,'Here are results');
see how it flows?? build a form, hand it to AceSearchTable, grab the params, search, then dump it all into AceResultsTable. chef's kiss π
π DESCRIPTION π
So Ace::Browser::SearchSubs exports a little bundle of constants and subroutines β and bestie, they are everything when you're building AceBrowser search scripts. Ready?
π CONSTANTS π
This package exports the following constants:
MAXOBJECTSβ the maximum number of objects that can be displayed per page. Like, the ceiling. Don't exceed it, iykyk.SEARCH_ICONβ an icon to use for search links. β οΈ heads up: this is deprecated. UseConfiguration->Search_iconinstead. it's giving "old news", we moved on π
π₯ FUNCTIONS π₯
These functions are exported:
$offset = AceSearchOffset()β when the user is paging back and forth among a multi-page list of results, this function returns the index of the first item to display. that's it, that's the job. it's the "where do I start counting" guy π«ΆAceSearchTable([{hash}],$title,@contents)β give it a title plus some HTML contents, and it formats the search into a table, paints it with the same background and foreground colors used elsewhere for searches, and then prints the formatted search out. The HTML contents are usually a fill-out form. For convenience, you can hand over the contents in multiple parts (lines or elements) and they'll all get concatenated together. And if that first argument is a hashref, its contents get passed tostart_form()to override the form arguments. so flexible, so iconic β¨AceResultsTable($objects,$count,$offset,$title)β this subroutine formats the results of a search into a pageable list and prints out the resulting HTML. The following arguments are required:$objectsβ an array reference containing the objects to place in the table.$countβ the total number of objects.$offsetβ the offset into the array, as returned byAceSearchOffset()$titleβ a title for the table.
π¨ important: the array reference should contain no more than MAXOBJECTS objects, and the AceDB query should be arranged in such a way that this is the case. don't be the main character who ignores this, bestie.
A typical idiom is the following:
my $offset = AceSearchOffset();
my $query = param('query');
my $count;
my @objs = $db->fetch(-query=> $query,
-count => MAXOBJECTS,
-offset => $offset,
-total => \$count
);
AceResultsTable(\@objs,$count,$offset,'Here are the results');
look at that -total => \$count sneaking the count in by reference. slay π
π BUGS π
Please report them. (yes, that's the whole section. short and honest, we love that for them. if you find one, go tell somebody π)
π SEE ALSO π
Ace::ObjectAce::Browser::SiteDefsAce::Browsr::AceSubs- the
README.ACEBROWSERfile
(and yes, Ace::Browsr::AceSubs is spelled exactly like that in the original β we do not correct the ancestors π
)
π AUTHOR π
Lincoln Stein <lstein@cshl.org>.
Copyright (c) 2001 Cold Spring Harbor Laboratory
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See DISCLAIMER.txt for disclaimers of warranty.
aaaand that's the whole page, no cap πΈ this absolute classic of a doc is perl v5.42.3, dated 2026-08-19, from that Ace::B...chSubs(3pm) corner of the man pages. go forth and write search scripts, you gorgeous nerd, ily πβ¨π¦
π¦ where this page comes from
- ubuntu stonking: libace-perl 1.92-14build1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms