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