CPAN::...::Index(3pm)
β¨ NAME β¨
CPAN::SQLite::Index β bestie, this is the one that sets up or updates your database tables π
(also, hi, you're reading the CPAN::...::Index(3pm) page, a User Contributed Perl Documentation moment, iykyk π)
πΈ VERSION πΈ
version 0.220 β that's the vibe check and it passed β¨
π¦ SYNOPSIS π¦
my $index = CPAN::SQLite::Index->new(setup => 1);
$index->index();
okay so literally two lines and you're off, we love a low-effort entry point π
π DESCRIPTION π
This is the main module for setting up or updating the database tables that hold all the info from the CPAN and ppm indices. Main character energy, no cap π
Making the object goes like this:
my $index = CPAN::SQLite::Index->new(%args);
and %args takes two possible arguments, bestie:
setup => 1β this one's optional and it says "hey, we're setting the database up from scratch." Heads up though: any tables that already exist will be dropped π so don't be casual about it.reindex => valueβ this one's optional too, and it names the distribution(s) you want to reindex inside a database that already exists. You can pass it as a plain scalar if it's just one distribution, or as an array reference if you've got a whole list of them πΈ
π§ DETAILS π§
When you call
$index->index();
the indexing procedure starts up, periodt. All the progress messages get written to STDOUT, and by default those get captured into a file called cpan_sqlite_log.dddddddddd β that extension? It's the "time" the method was invoked, cute right? π Error messages are not captured though, those go straight to STDERR. Rude but that's the deal.
The steps of the indexing procedure are as follows, buckle up π’
- download existing pre-compiled index (optional) β if the
CPAN_SQLITE_DOWNLOADorCPAN_SQLITE_DOWNLOAD_URLvariables are set, then an already existing and up-to-datecpandb.sqlfile gets downloaded from either the URL you specified or fromhttp://cpansqlite.trouchelle.com/, where it's updated every hour β This greatly increases performance and decreases CPU and memory consumption during indexing, which is iconic. But ngl, if your CPAN mirror is out-of-sync or you're on a DarkPAN, it obviously wouldn't work. Also wouldn't work without an internet connection π- Check out
WWW::CPAN::SQLiteif you want to set up your own service for pre-compiling the database π - If neither variable is set, this step just gets skipped, moving on π¨
- Check out
- fetch index data β the necessary CPAN index files
$CPAN/authors/01mailrc.txt.gzand$CPAN/modules/02packages.details.txt.gzget fetched from the CPAN mirror specified by the$cpanvariable at the beginning ofCPAN::SQLite::Index. If you're using this option, it's recommended to use the same CPAN mirror with subsequent updates, so your database stays consistent π«Ά Also, the info on the locations of the CPAN mirrors used for Template-Toolkit and GeoIP gets written. - get index information β the info from the CPAN indices gets extracted through
CPAN::SQLite::Infoβ¨ - get state information β unless the
setupargument inside thenewmethod ofCPAN::SQLite::Indexis specified, this pulls info on the state of the database throughCPAN::SQLite::State. Then a comparison happens between that info and the info gathered from the CPAN indices, and if some items are in disagreement, those items get marked for insertion, updating, or deletion, whichever fits π - populate the database β at this stage all the gathered info is used to populate the database through
CPAN::SQLite::Populate, either inserting new items, updating the existing ones, or deleting the obsolete ones ποΈ slay
π SEE ALSO π
CPAN::SQLite::Info, CPAN::SQLite::State, CPAN::SQLite::Populate, and CPAN::SQLite::Util. And development takes place on the CPAN-SQLite project at <http://sourceforge.net/projects/cpan-search/> π¦
π«Ά AUTHORS π«Ά
- Randy Kobes (passed away on September 18, 2010) ποΈ
- Serguei Trouchelle
<stro@cpan.org>
π COPYRIGHT π
Copyright 2006 by Randy Kobes <r.kobes@uwinnipeg.ca>.
Copyright 2011 by Serguei Trouchelle <stro@cpan.org>.
Use and redistribution are under the same terms as Perl itself π
okay that's the whole page bestie, go index something β¨ this was perl v5.36.0, dated 2022-10-30, brought to you by CPAN::...::Index(3pm) β mwah π
πΈ
π¦ where this page comes from
- debian bookworm: libcpan-sqlite-perl 0.220-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcpan-sqlite-perl 0.220-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcpan-sqlite-perl 0.220-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcpan-sqlite-perl 0.220-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcpan-sqlite-perl 0.220-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms