handle bad config lines better
This commit is contained in:
parent
fe829e7a4b
commit
f4dfd88d9f
|
@ -78,7 +78,11 @@ BEGIN
|
||||||
{
|
{
|
||||||
next if ( $str =~ /^\s*$/ );
|
next if ( $str =~ /^\s*$/ );
|
||||||
next if ( $str =~ /^\s*#/ );
|
next if ( $str =~ /^\s*#/ );
|
||||||
my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.+?)\s*$/;
|
my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.*?)\s*$/;
|
||||||
|
if ( ! $name ) {
|
||||||
|
print( STDERR "Warning, bad line in $config_file: $str\n" );
|
||||||
|
next;
|
||||||
|
} # end if
|
||||||
$name =~ tr/a-z/A-Z/;
|
$name =~ tr/a-z/A-Z/;
|
||||||
*{$name} = sub { $value };
|
*{$name} = sub { $value };
|
||||||
push( @EXPORT_CONFIG, $name );
|
push( @EXPORT_CONFIG, $name );
|
||||||
|
|
Loading…
Reference in New Issue