CPAN::...::META(3pm)
π NAME π
okay bestie, gather round β this is CPAN::SQLite::META, and she's the little helper module that makes CPAN.pm and CPAN::SQLite get along. no cap. it's the matchmaker, the group-chat admin, the one doing the behind-the-scenes work so everyone else can shine. π
β¨ VERSION β¨
this is version 0.220. periodt. π
πΈ DESCRIPTION πΈ
so like, real talk: this module has no direct public interface. she's not here for randoms. she's a helper module, designed for CPAN::SQLite to be used inside the CPAN.pm module. iykyk. π¦
you make a new object like this:
my $obj = CPAN::SQLite::META->new($CPAN::META);
where $CPAN::META comes from CPAN.pm. and then boom β you've got two main methods to play with. π
π«Ά set
it's used like this:
$obj->set($class, $id);
where $class is one of CPAN::Author, CPAN::Module, or CPAN::Distribution, and $id is the id CPAN.pm uses to identify the class. π
what does it do? it searches the CPAN::SQLite database by name, using the appropriate author, dist, or module mode, and if a result is found, it calls
$CPAN::META->instance(
$class => $id
)->set(
%attributes
);
to register an instance of this class within CPAN.pm. iconic behaviour honestly.
π ssearch
(yeah, the heading says ssearch, we don't ask questions, we just vibe π)
it's used like this:
$obj->search($class, $id);
where $class is one of CPAN::Author, CPAN::Module, or CPAN::Distribution, and $id is the id CPAN.pm uses to identify the class. β¨
this one searches the CPAN::SQLite database by query using the appropriate author, dist, or module mode, and if results are found, it calls
$CPAN::META->instance(
$class => $id
)->set(
%attributes
);
for each match to register an instance of this class within CPAN.pm. multiple matches? she's handling all of them, no stress. π
the attributes set within $CPAN::META-instance> depend on the particular class. so let's go class by class, bestie. π
π§ author
the attributes are
'FULLNAME' => $results->{fullname},
'EMAIL' => $results->{email},
where $results are the results returned from CPAN::SQLite. simple. clean. slay. β¨
π module
the attributes are
'description' => $results->{mod_abs},
'userid' => $results->{cpanid},
'CPAN_VERSION' => $results->{mod_vers},
'CPAN_FILE' => $results->{download},
'CPAN_USERID' => $results->{cpanid},
where $results are the results returned from CPAN::SQLite. look at that list, she's thorough. π
π dist
the attributes are
'DESCRIPTION' => $results->{dist_abs},
'CPAN_USERID' => $results->{cpanid},
'CPAN_VERSION' => $results->{dist_vers},
as well, a CONTAINSMODS key to $CPAN::META is added, this being a hash reference whose keys are the modules contained within the distribution. so she's not just setting attributes, she's dropping a whole hash ref of receipts. π
there's also a method available reload, which rebuilds the database. π οΈ
it can be used as
$obj->reload(force => 1, time => $time);
so the time option β which, if not passed in, will default to the current time β gets used to compare the current time to the mtime of the database file. if they differ by more than one day, the database gets rebuilt. π
and the <force> option, if given, will force a rebuilding of the database regardless of the time difference. so if you want it rebuilt right now, no waiting around, that's your girl. π₯
ngl the force option is giving main character energy β it does not care about your mtime math, it just rebuilds. π«Ά
and that's the whole page, bestie! written by the lovely perl people, perl v5.36.0, dated 2022-10-30 β mwah, thank you for coming to my ted talk, drink some water, run your tests, and stan a helper module that stays in her lane. ππβ¨
π¦ 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