1
0
Fork 0
forked from lix-project/lix
lix/scripts/readconfig.pm.in

18 lines
350 B
Perl
Raw Normal View History

2006-05-31 09:24:54 +00:00
use strict;
sub readConfig {
my %config;
my $config = "@sysconfdir@/nix/nix.conf";
return unless -f $config;
open CONFIG, "<$config" or die "cannot open `$config'";
while (<CONFIG>) {
/^\s*([\w|-]+)\s*=\s*(.*)$/ or next;
$config{$1} = $2;
print "|$1| -> |$2|\n";
}
close CONFIG;
}
return 1;