Config:...hBundles(3)

✨ NAME ✨

okay so like, this is Config::MVP::Assembler::WithBundles β€” a role that makes assemblers expand bundles πŸ’– (it lives in the User Contributed Perl Documentation, section 3, iykyk)


πŸ’« VERSION πŸ’«

version 2.200013 β€” bestie, that's the one we're working with πŸŽ€


🌸 DESCRIPTION 🌸

so Config::MVP::Assembler::WithBundles is literally a role that you compose into a Config::MVP::Assembler subclass. what does it do? it lets some sections of your config be treated as bundles. and the way that works is: whenever any section gets ended, if that section was representing a bundle, its bundle contents get unrolled and they replace it in the sequence. periodt. πŸ’…

a package counts as a bundle if package_bundle_method returns a defined value β€” and that value is the name of a method that'll be called on that package to go get its bundle config. like:

my $method = $assembler->package_bundle_method($package);

the default implementation is out here looking for a method called mvp_bundle_config, but no cap, you can swap package_bundle_method out for one that returns the name of a different bundle-identifying method-name. customize her πŸ’…βœ¨

bundles get expanded by a call to the assembler's replace_bundle_with_contents method, like this:

$assembler->replace_bundle_with_contents($section, $method);

πŸ¦‹ replace_bundle_with_contents πŸ¦‹

the default replace_bundle_with_contents method deletes the section from the sequence. then it gets a description of the new sections it's supposed to introduce, like this:

my @new_config = $bundle_section->package->$method({
  name    => $bundle_section->name,
  package => $bundle_section->package,
  payload => $bundle_section->payload,
});

(and yes bestie, we pass a hashref instead of a section on purpose β€” so that bundles can be expanded synthetically without having to laboriously create a whole new Section. we're efficient like that 😌)

the returned @new_config is a list of arrayrefs, and each one has three entries:

[ $name, $package, $payload ]

every arrayref gets converted into a section in the sequence. and the $payload? that should be an arrayref of name/value pairs that get added to the created section. 🫢


🐚 PERL VERSION 🐚

ngl this module should work on any version of perl that's still receiving updates from the Perl 5 Porters. which means: any version of perl released in the last two to three years. (like, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.) πŸ’€

although it may work on older versions of perl, there is no guarantee that the minimum required version won't get increased. the version may be increased for any reason, and there's no promise that patches will be accepted to lower the minimum required perl. so don't come for her πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Ricardo Signes <cpan@semiotic.systems> β€” iconic, we stan πŸ’œ


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 ✨


and that's the whole vibe check, bestie β€” this was perl v5.42.0, dated 2025-07-25, and it's the Config:...hBundles(3) page from the User Contributed Perl Documentation. go forth and unroll those bundles πŸ¦‹πŸŒΈπŸ’–

πŸ“¦ where this page comes from