Net::SSH::Perl::Config - Load and manage SSH configuration
my $cfg = Net::SSH::Perl::Config->new($host, foo => 'bar');
my $v = $cfg->get('foo');
manages configuration data for
. It merges options handed to it at object construction
with options read from configuration files. Just as in the actual ssh program,
the first obtained value of a configuration parameter is the value that's
used; in other words, values given in the original parameter list will always
override values read from configuration files.
The configuration files should be in the same format used for the ssh command
line program; see the ssh
manpage for information on this format.
understands a subset of the configuration
directives that can live in these files; this subset matches up with the
functionality that Net::SSH::Perl
can support. Unknown keywords will
simply be skipped.
Constructs a new configuration container object and returns that object.
is the host to which you're applying this
configuration; you can leave it out (pass in an undefined or empty argument)
if it's not applicable to you.
is needed for parsing the host-specific sections of
the configuration files; the Host
keyword restricts a set of directives
as applying to a particular host (or set of hosts). When it encounters such a
will skip all of the directives in the
section unless the host matches $host
can contain the same arguments that you can pass to
method of Net::SSH::Perl
--those arguments are eventually
passed through to this method when setting up the SSH object. The elements in
override values in the configuration files.
Reads in the configuration file $file
and adds any
appropriate configuration data to the settings maintained by the
object. If $file
unreadable, simply returns quietly.
As stated above, values read from the configuration files are overridden by
those passed in to the constructor. Furthermore, if you're reading from
several config files in sequence, values read from the first files will
override those read from the second, third, fourth, etc. files.
Merges the directive option $line
into the configuration
settings in $cfg
should be an
option in the format used in the config file, eg. "BatchMode
. This is useful for merging in directives that are not
necessarily in the config file, similar to how the -o
option works in
command line program.
Returns the value of the configuration parameter $key
undefined if that parameter has not been set.
Sets the value of the parameter $key
, and returns the new value.
Please see the Net::SSH::Perl manpage for author, copyright, and license