Scroll to navigation

CPAN::SQLite::META(3pm) User Contributed Perl Documentation CPAN::SQLite::META(3pm)

NAME

CPAN::SQLite::META - helper module for CPAN.pm integration

VERSION

version 0.220

DESCRIPTION

This module has no direct public interface, but is intended as a helper module for use of CPAN::SQLite within the CPAN.pm module. A new object is created as

  my $obj = CPAN::SQLite::META->new($CPAN::META);

where $CPAN::META comes from CPAN.pm. There are then two main methods available.

"set"
This is used as

   $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. The method searches the "CPAN::SQLite" database by name using the appropriate "author", "dist", or "module" mode, and if a result is found, calls

    $CPAN::META->instance(
                         $class => $id
                         )->set(
                          %attributes
                         );
    

to register an instance of this class within "CPAN.pm".

"ssearch"
This is used as

   $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. The method searches the "CPAN::SQLite" database by "query" using the appropriate "author", "dist", or "module" mode, and if results are found, calls

    $CPAN::META->instance(
                         $class => $id
                         )->set(
                          %attributes
                         );
    

for each match to register an instance of this class within "CPAN.pm".

The attributes set within "$CPAN::META-"instance> depend on the particular class.

The attributes are

       'FULLNAME' => $results->{fullname},
       'EMAIL' => $results->{email},
    

where $results are the results returned from "CPAN::SQLite".

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".

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.

There is also a method available "reload", which rebuilds the database. It can be used as

   $obj->reload(force => 1, time => $time);

The "time" option (which, if not passed in, will default to the current time) will be used to compare the current time to the mtime of the database file; if they differ by more than one day, the database will be rebuilt. The <force> option, if given, will force a rebuilding of the database regardless of the time difference.

2022-10-30 perl v5.36.0