#!/usr/bin/env perl use Getopt::Long; use Config::General; $PROGNAME = "myscript"; # Get Options from commandline my $nodename; usage() if ( @ARGV < 1 or ! GetOptions( "nodename=s"=>\$nodename )); my $conf = new Config::General( -ConfigFile => $PROGNAME . '.conf', -ExtendedAccess => 1 ); &read_config; sub read_config { if ($conf->is_hash($nodename)) { $config = $conf->obj($nodename); } else { print "Critical error: No configuration list found for $nodename\n"; } } #### host = server1.domain.tld ssl = true port = 443 username = admin password = qwerty vhost = example host = server2.domain.tld ssl = false port = 2080 username = admin password = qwerty vhost = example