+
+open(INIFILE,"<$ENV{HOME}/.snomrc") || die("can't open config: $ENV{HOME}/.snomrc: $!");
+my %Config = ();
+my @sections = ();
+while(<INIFILE>) {
+ chomp;
+ if (m/^\s*\[(.*)\]\s*$/) {
+ push @sections, $1;
+ next;
+ }
+
+ if ($#sections) {
+ for my $var (qw(host login password)) {
+ if (m/^\s*${var}\s*=\s*(.*)\s*$/) {
+ push @{$Config{$sections[$#sections]}}, ($var => $1);
+ }
+ }
+ }
+}
+close(INIFILE);
+
+
+for my $section (@sections) {
+ for my $val (@{$Config{$section}}) {
+ print $val."\n";
+ #for my $val (qw(host login password)) {
+ # if (defined($cfg->val($section, $val))) {
+ # print "$val: <" . $cfg->val($section, $val) . ">\n";
+ # }
+ #}
+
+ }
+}
+
+
+