8 @LiCoM::Config::EXPORT_OK = ('get_config read_config');
9 @LiCoM::Config::ISA = ('Exporter');
15 =head1 STATIC FUNCTIONS
19 =item LiCoM::Config-E<gt>B<get_config> (I<$key>)
21 Returns the value for I<$key> or undef if it's unknown.
35 return ($Config->{$key});
38 =item LiCoM::Config-E<gt>B<set_config> (I<$key>, I<$value>)
40 Sets the value of I<$key> to I<$value>.
50 $Config->{$key} = $val;
53 =item LiCoM::Config-E<gt>B<read_config> ([I<@files>])
55 Read the config from the files given or F</etc/licom/licom.conf> and
56 F<~/.licomrc> if no files were given.
62 my @files = ('/etc/licom/licom.conf');
68 elsif (defined ($ENV{'HOME'}) and (-d $ENV{'HOME'}))
70 push (@files, $ENV{'HOME'} . '/.licomrc');
76 next unless (-r $file);
78 read_file ($file, $config);
86 my $file = @_ ? shift : '/etc/licom/licom.conf';
87 my $config = @_ ? shift : {};
90 open ($fh, "< $file") or die ("open ($file): $!");
96 if ($line =~ m/^(\w+):\s*"(.+)"\s*$/)
101 $config->{$key} = $val;
114 Florian octo Forster E<lt>octo at verplant.orgE<gt>