Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
Rex::Config(3)	      User Contributed Perl Documentation	Rex::Config(3)

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

perl v5.24.1			  2016-07-16			Rex::Config(3)

NAME | DESCRIPTION | EXPORTED METHODS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=Rex::Config&sektion=3&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help