1 package PciIds::Config;
7 our @EXPORT = qw(&checkConf &defConf %config &confList);
12 open CONFIG, $directory."/config" or die "Config file not found. Make sure config is in the directory and the correct path is in Startup.pm\n";
14 next if( /^\s*(|#.*)$/ );
17 die "Invalid syntax on line $_\n" unless( ( $name, $val ) = /^\s*(.*\S)\s*=\s*(.*\S)\s*$/ );
18 $val =~ s/^"(.*)"$/$1/;
19 ( $val ) = ( $val =~ /(.*)/ ); #Untaint the value - config is considered part of the program
20 $config{$name} = $val;
27 foreach( @{$names} ) {
28 die "Variable not set: $_\n" unless( defined $config{$_} );
34 foreach( keys %{$underlay} ) {
35 $config{$_} = $underlay->{$_} unless( defined $config{$_} );
42 push @result, $config{$_} foreach( @{$names} );