table of contents
other versions
- buster 1.6.0-1
- buster-backports 1.12.2-1~bpo10+1
- testing 1.13.2-1
- unstable 1.13.3-1
Rex::Config(3pm) | User Contributed Perl Documentation | Rex::Config(3pm) |
NAME¶
Rex::Config - Handles the configuration.DESCRIPTION¶
This module holds all configuration parameters for Rex.With this module you can specify own configuration parameters for your modules.
EXPORTED METHODS¶
register_set_handler($handler_name, $code)¶
Register a handler that gets called by set.Rex::Config->register_set_handler("foo", sub { my ($value) = @_; print "The user set foo -> $value\n"; });
And now you can use this handler in your Rexfile like this:
set foo => "bar";
register_config_handler($topic, $code)¶
With this function it is possible to register own sections in the users config file ($HOME/.rex/config.yml).Example:
Rex::Config->register_config_handler("foo", sub { my ($param) = @_; print "bar is: " . $param->{bar} . "\n"; });
And now the user can set this in his configuration file:
base: user: theuser password: thepassw0rd foo: bar: baz
2018-02-01 | perl v5.26.1 |