CPAN::...Config(3pm)
π CPAN::Mini::Inject::Config π
okay so bestie, welcome to the manual page for CPAN::Mini::Inject::Config β the config class for CPAN::Mini::Inject, from the User Contributed Perl Documentation corner of the universe. it's giving "tiny file, big responsibility" and honestly? we're obsessed. π
β¨ NAME β¨
CPAN::Mini::Inject::Config β Config for CPAN::Mini::Inject. that's it, that's the whole name, no cap. π
πΈ SYNOPSIS πΈ
my $config = CPAN::Mini::Inject::Config->new;
literally one line and you're in. iconic behavior. β¨
π¦ DESCRIPTION π¦
π Configuration π
This is the default class dealing with the default CPAN::Mini::Inject config. The simplest config is a key-value file:
local: t/local/CPAN
remote : http://localhost:11027
repository: t/local/MYCPAN
dirmode: 0775
passive: yes
This module digests that and returns it as a hash reference. Any module that wants to use a different sort of config structure needs to return the same hash:
{
local => 't/local/CPAN',
remote => 'http://localhost:11027',
repository => 't/local/MYCPAN',
dirmode => '0775',
passive => 'yes',
}
so yeah, swap out the config format if you want, but the shape of the hash is non-negotiable. main character consistency. π
here come the directives, bestie. all of them. no skipping, we don't do that here. π«Ά
dirmodeβ sets the permissions of created directories to the specified mode. the default value is based onumaskif that's supported. πforceβ passthrough toCPAN::Mini. just vibes, just passing it along.localβ (required) the location to store the localCPAN::Minimirror. you literally cannot skip this one, it's the whole point. πlog_levelβ passthrough toCPAN::Mini.module_filtersβ passthrough toCPAN::Mini.passiveβ enable passive FTP. πremoteβ (required) the CPAN site(s) to mirror from. multiple sites can be listed space separated. yes bestie, you can stack them. π₯repositoryβ the location to store modules to add to the localCPAN::Minimirror.skip_cleanupβ passthrough toCPAN::Mini.skip_perlβ passthrough toCPAN::Mini.traceβ passthrough toCPAN::Mini.
π§ Methods π§
π "new" π
the constructor. that's the entry point, that's the doorway, that's the moment. β¨
π config_file( [FILE] ) π
give it a file if you want, or don't, it's flexible like that.
π¦ load_config() π¦
okay so loadcfg accepts a CPAN::Mini::Inject config file, or β if nothing is defined β it will search the following four places, in order:
- the file pointed to by the environment variable
MCPANI_CONFIGπΈ $HOME/.mcpani/config/usr/local/etc/mcpani/etc/mcpani
loadcfg sets the instance variable cfgfile to the file found, or to undef if none is found. so if it comes back empty-handed, that's your sign. π
print "$mcpi->{cfgfile}\n"; # /etc/mcpani
look at that, it found /etc/mcpani. slay. π
π parse_config() π
parsecfg reads the config file stored in the instance variable cfgfile and creates a hash in config with each setting.
$mcpi->{config}{remote} # CPAN sites to mirror from.
parsecfg expects the config file in the following format:
local: /www/CPAN
remote: http://cpan.metacpan.org/
repository: /work/mymodules
passive: yes
dirmode: 0755
β οΈ heads up bestie: if eitherlocalorremoteare not defined,parsecfgcroaks. like, actually dies. do not test it. π
β get( DIRECTIVE ) β
return the value for the named configuration directive. simple, clean, effective. π«Ά
π "set( DIRECTIVE, VALUE )" π
sets the value for the named configuration directive. now you're the one in charge. π
π AUTHOR π
Shawn Sorichetti "<ssoriche@coloredblocks.net>" β legend behavior, honestly. π
π₯ SOURCE AVAILABILITY π₯
The main repository is on GitHub:
https://github.com/briandfoy/cpan-mini-inject
There are also backup repositories on several other services:
https://bitbucket.org/briandfoy/cpan-mini-inject
https://codeberg.org/briandfoy/cpan-mini-inject
https://gitlab.com/briandfoy/cpan-mini-inject
redundancy queen. we love a girl with backups. π β¨
π COPYRIGHT & LICENSE π
Copyright 2004 Shawn Sorichetti, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π¦ this beauty shipped with perl v5.40.1 and it's dated 2025-04-12 β so go forth, write your config, and remember: local and remote are required, and we don't negotiate with croaks. π mwah, bye!! πβ¨
π¦ where this page comes from
- debian trixie: libcpan-mini-inject-perl 1.012-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcpan-mini-inject-perl 1.012-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcpan-mini-inject-perl 1.012-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