GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Net::SSH::Perl::Config(3) User Contributed Perl Documentation Net::SSH::Perl::Config(3)

Net::SSH::Perl::Config - Load and manage SSH configuration

    use Net::SSH::Perl::Config;
    my $cfg = Net::SSH::Perl::Config->new($host, foo => 'bar');
    $cfg->read_config($config_file);
    my $v = $cfg->get('foo');

Net::SSH::Perl::Config manages configuration data for Net::SSH::Perl. 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. Net::SSH::Perl::Config 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. $host 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.

$host 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 section, Net::SSH::Perl::Config will skip all of the directives in the section unless the host matches $host.

%args can contain the same arguments that you can pass to the new method of Net::SSH::Perl--those arguments are eventually passed through to this method when setting up the SSH object. The elements in %args override values in the configuration files.

Reads in the configuration file $file and adds any appropriate configuration data to the settings maintained by the $cfg object. If $file is 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. $line should be an option in the format used in the config file, eg. "BatchMode yes". This is useful for merging in directives that are not necessarily in the config file, similar to how the -o option works in the ssh command line program.

Returns the value of the configuration parameter $key, and undefined if that parameter has not been set.

Sets the value of the parameter $key to $value , and returns the new value.

Please see the Net::SSH::Perl manpage for author, copyright, and license information.
2017-08-24 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.