Config:...::Reader(3)
β¨ Config::MVP::Reader β¨
okay bestie so this is a section 3 man page from the User Contributed Perl Documentation set, and the star of the show is Config::MVP::Reader π she's the one who reads your config and hands it off, no cap.
πΈ NAME πΈ
Config::MVP::Reader β an object that reads config from storage and feeds it into an assembler π«Ά
π VERSION π
version 2.200013 β yes bestie, that's the one, iykyk β¨
π¦ SYNOPSIS π¦
use Config::MVP::Reader::YAML; # this doesn't really exist
my $reader = Config::MVP::Reader::YAML->new;
my $sequence = $reader->read_config('/etc/foobar.yml');
(and yes, before you @ me: that Config::MVP::Reader::YAML doesn't really exist β it's just here to show you the vibe π)
π DESCRIPTION π
so here's the whole thing, bestie. A Config::MVP::Reader exists to read configuration data from storage (like, a file, obviously) and convert that data into instructions for a Config::MVP::Assembler, which then turns them into a Config::MVP::Sequence β the final product, the main character, the moment π
like it's a whole pipeline and she's the first step, periodt.
π PERL VERSION π
This module should work on any version of perl that's still getting updates from the Perl 5 Porters. which means... any version of perl released in the last two to three years. so if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38 π
and like, yeah, it may work on older versions of perl, but no guarantee is made that the minimum required version won't get bumped. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so don't come for her, she said what she said π
β ATTRIBUTES β
π add_cwd_to_lib
If true (which it is by default, so yes, she's on by default bestie) then the current working directory will be locally added to @INC during config loading. this helps deal with changes made in Perl v5.26.1. iconic workaround behavior, honestly π
π₯ METHODS π₯
π§ read_config
my $sequence = $reader->read_config($location, \%arg);
This method is passed a location, which has no set meaning, but should be the mechanism by which the Reader is told how to locate configuration. It might be a file name, a hashref of parameters, a DBH, or literally anything else, depending on the needs of the specific Reader subclass. she's flexible like that π
It's also passed a hashref of arguments, and of those there is only one valid argument:
assemblerβ the Assembler object into which to read the config
If no assembler argument is passed, one will be constructed by calling the Reader's build_assembler method. she'll build her own bestie, it's fine β¨
Subclasses should generally not overrideread_config, but should instead implement aread_into_assemblermethod, described below. If a subclass does overrideread_config, it should take care to respect theadd_cwd_to_libattribute, above. don't skip that part, bestie, it matters π
π read_into_assembler
This method should not be called directly. It is called by read_config with the following parameters:
my $sequence = $reader->read_into_assembler( $location, $assembler );
The method should read the configuration found at $location and use it to instruct the $assembler (a Config::MVP::Assembler) what configuration to perform.
The default implementation of this method will throw an exception complaining that it should have been implemented by a subclass. so like, if you didn't do your homework, she's gonna yell π«Ά
π build_assembler
If no Assembler is provided to read_config's assembler parameter, this method will be called on the Reader to construct one.
It must return a Config::MVP::Assembler object, and by default will return an entirely generic one. lowkey the most chill method here fr fr π
πΈ AUTHOR πΈ
Ricardo Signes <cpan@semiotic.systems>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2022 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, open source queen π
okay that's the whole page bestie, you ate that π«Ά and just so you have the receipts: this was perl v5.42.0, dated 2025-07-25, from Config:...::Reader(3). mwah πβ¨
π¦ where this page comes from
- fedora 43: perl-Config-MVP 2.200013-9.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Config-MVP 2.200013-9.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms