DBM::D...figData(3pm)

πŸ“¦
version 2.0019 Β· 5 versions
, in opensuse-leap 16.0

✨ NAME ✨

DBM::Deep::ConfigData β€” the whole entire configuration situation for DBM::Deep, bestie πŸ’… (also, hi, this page is part of the User Contributed Perl Documentation β€” DBM::D...figData(3pm) if you're keeping score πŸŽ€)


🌸 SYNOPSIS 🌸

use DBM::Deep::ConfigData;
$value = DBM::Deep::ConfigData->config('foo');
$value = DBM::Deep::ConfigData->feature('bar');

@names = DBM::Deep::ConfigData->config_names;
@names = DBM::Deep::ConfigData->feature_names;

DBM::Deep::ConfigData->set_config(foo => $new_value);
DBM::Deep::ConfigData->set_feature(bar => $new_value);
DBM::Deep::ConfigData->write;  # Save changes

No cap, that's the whole vibe up there. πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

Okay so picture this: DBM::Deep::ConfigData is the module that holds the configuration data for the DBM::Deep module. That's literally its whole job. 🫢

It also hands you a programmatic interface for getting or setting that configuration data β€” so you're not out here editing files like a peasant, you're doing it through methods. Iconic.

⚠️ Real talk though: in order to actually make changes, you'll have to have write access to the DBM::Deep::ConfigData module. And you should attempt to understand the repercussions of your actions. Like, yes bestie, go off, but know what you're doing first 😭 this is config, not a group chat.

πŸŽ€ METHODS πŸŽ€

config($name)

Give it a string argument and it returns the value of the configuration item with that name. If there's no such item? undef. That's it. That's the whole method. ✨

feature($name)

Same energy: hand it a string argument, get back the value of the feature by that name. No such feature? undef, and it's not even sorry. πŸ’…

set_config($name, $value)

Sets the configuration item with the given name to the given value. And here's the fun part β€” the value may be any Perl scalar that will serialize correctly using Data::Dumper. That includes references, objects (usually), and complex data structures. It probably does not include transient things like filehandles or sockets. So like, don't try it with a socket, bestie, that's giving unserializable 🫠

set_feature($name, $value)

Sets the feature with the given name to the given boolean value. The value will be converted to 0 or 1 automatically β€” so it does the whole "truthy/falsy" cleanup for you. Slay. πŸ”₯

config_names()

Returns a list of all the names of config items currently defined in DBM::Deep::ConfigData. In scalar context? Returns the number of items instead. Versatile queen. πŸ‘‘

feature_names()

Returns a list of all the names of features currently defined in DBM::Deep::ConfigData, or in scalar context, the number of features. Same deal as above, just features. ✨

auto_feature_names()

Returns a list of all the names of features whose availability is dynamically determined, or in scalar context, the number of such features. Important caveat: it does not include such features that have later been set to a fixed value. So if you pinned one down, it's out of this list. πŸ™ˆ

write()

Commits any changes from set_config() and set_feature() to disk. Requires write access to the DBM::Deep::ConfigData module β€” yes, again. It's a whole thing. 😭


🌈 AUTHOR 🌈

DBM::Deep::ConfigData was automatically created using Module::Build. Module::Build was written by Ken Williams, but he holds no authorship claim or copyright claim to the contents of DBM::Deep::ConfigData. So like, credit where it's due, but also not his content. Respect the nuance. 🫢


And that's the page, bestie β€” brought to you by perl v5.42.0, dated 2023-11-13, and filed under DBM::D...figData(3pm). Go forth and configure responsibly βœ¨πŸ’…

πŸ“¦ where this page comes from