LCFG::Component::Plugin::Env - Set environment variables for LCFG component methods
This documentation refers to LCFG::Component::Plugin::Env version 1.14.1
use LCFG::Component::Plugin::Env;
my $plugin = LCFG::Component::Plugin::Env->new(
component => $comp,
params_list => ["FOO","BAR"],
params => { FOO => "Hello",
BAR => "World", },
);
$plugin->run();
This is an LCFG component environment initialization module. It is sub-class of LCFG::Component::Plugin which can be used to set environment variables before an LCFG component method is called.
The base class has the following attributes:
This is a reference to the LCFG::Component object from which this plugin was loaded. This is useful for logging and gaining access to the various variables which control the logging levels (e.g. debug, verbose).
This is a list of names of parameters which were specified in the ngeneric resources.
If you call this method in a list context it returns a list otherwise it returns a reference to a list.
This is a reference to a hash of the names and values of the parameters which were specified in the ngeneric resources.
This creates a new plugin object, it takes the following attributes: component
, params_list
and params
. See the list above for details. See the LCFG RESOURCES section below for details on how the ngeneric resources for a component are mapped into the params list.
The parameters are a list of names and values for environment variables which must be set prior to calling an LCFG component method.
This is a convenience method which returns the value of the named parameter from the params
hash.
For each parameter this will set an environment variable of the same name with whatever value was specified. For example, with ng_plugin_params_env set to foo bar
and ng_plugin_param_env_bar set to test2
and ng_plugin_param_env_foo set to test
there will be an environment variable named foo
set with the value test
and a there will be an environment variable named bar
set with the value test2
.
This module is a sub-class of LCFG::Component::Plugin.
This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.
ScientificLinux6, EnterpriseLinux7, MacOSX
Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.
Paul Anderson <dcspaul@inf.ed.ac.uk>
Copyright (C) 2014 University of Edinburgh. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.
Hey! The above document had some coding errors, which are explained below:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'