Ace::Local(3pm)
π Ace::Local π
okay so this is the Ace::Local page from the User Contributed Perl Documentation, and bestie, it's literally the low-level plumbing that opens a local connection to an Ace database using giface, tace or gifaceclient. she's niche but she's iconic. π«Ά
β¨ NAME β¨
Ace::Local β use giface, tace or gifaceclient to open a local connection to an Ace database. no cap, that's the whole vibe. π
πΈ SYNOPSIS πΈ
use Ace::Local
my $ace = Ace::Local->connect(-path=>'/usr/local/acedb/elegans');
$ace->query('find author Se*');
die "Query unsuccessful" unless $ace->status;
$ace->query('show');
while ($ace->encore) {
print $ace->read;
}
π DESCRIPTION π
So this class exists for low-level access to local (aka non-networked) Ace databases, and it does that through the giface program. tbh you will generally not need to touch it directly β use Ace.pm instead, she's the main character here. π
For the sake of completeness (and because we're thorough like that), this method can also use the aceclient program for its access. Buuut the Ace::AceDB class is more efficient for that purpose, so likeβ¦ noted. π
π¦ METHODS π¦
π connect()
$accessor = Ace::Local->connect(-path=>$path_to_database);
Connects to the database at the path you gave, using giface, and hands you back a connection object (an "accessor" β¨). Giface must be on the current search path. And yes, you can have multiple accessors open at the same time β the more the merrier, she's polyamorous with connections. π
Arguments include:
-pathβ the path to the database (i.e. where thewspec/directory lives). π-programβ use this to point at the location of thegifaceorgifaceclientexecutable you want. You can also usetaceoraceclient, but in that case theasGIF()functionality will nog work. π Can be used to override the search path.-hostβ used when invokinggifaceclient. Says which host to connect to. π-portβ used when invokinggifaceclient. Says which port to connect to. π-nosyncβ ordinarilyAce::Localsynchronizes with thetace/gifaceprompt, yeeting all the warnings and copyright messages. If this is set,Ace::Localjust won't do that. In that case you must call thelow_read()method until it returnsundefin order to synchronize. π€
π query()
$status = $accessor->query('query string');
Sends the query string off to the server and returns a true value if it worked. Then you have to call read() over and over to actually fetch the query result β she doesn't hand it all over at once, that's just not her style. π
π read()
Reads the result from the last query you sent to the server and returns it as a string. ACE may return the result in pieces, breaking between whole objects, so you may need to read repeatedly to fetch the entire result. Canonical example, bestie, memorise it:
$accessor->query("find Sequence D*");
die "Got an error ",$accessor->error() if $accessor->status == STATUS_ERROR;
while ($accessor->status == STATUS_PENDING) {
$result .= $accessor->read;
}
π low_read()
Reads whatever data's available, or returns undef if there's none. This one is only used by the ace.pl replacement for giface/tace, so it's giving very much background-character energy. π§
π status()
Returns the status code from the last operation. Status codes are exported by default when you use Ace.pm. The status codes you may see are:
STATUS_WAITING The server is waiting for a query.
STATUS_PENDING A query has been sent and Ace is waiting for
you to read() the result.
STATUS_ERROR A communications or syntax error has occurred
π error()
May return a more detailed error code supplied by Ace. Error checking is not fully implemented β lowkey a work in progress, we don't talk about it. π
π encore()
This method returns true after you've done one or more read() operations, and it signals that there's more data to read. encore() is functionally equivalent to:
$encore = $accessor->status == STATUS_PENDING;
In fact, that's literally how it's implemented. fr fr. π―
π auto_save()
Sets or queries the auto_save variable. If it's true, the "save" command gets issued automatically before the connection to the database is severed. The default is true. periodt.
Examples:
$accessor->auto_save(1);
$flag = $accessor->auto_save;
π SEE ALSO π
Ace, Ace::Object, Ace::Iterator, Ace::Model β go read those too, they're the supporting cast and they ate. π
π AUTHOR π
Lincoln Stein <lstein@w3.org> with extensive help from Jean Thierry-Mieg <mieg@kaa.crbm.cnrs-mop.fr> π«Ά
Copyright (c) 1997-1998, Lincoln D. Stein
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.
ok that's the whole page, bestie, you're officially educated π
and finally, the cute lil sign-off: this was perl v5.42.3, dated 2026-08-19, and yes, the page is Ace::Local(3pm). slay, go write some queries. β
π¦ 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