X-Git-Url: https://git.p6c8.net/devedit.git/blobdiff_plain/e34b89e8690b4766fc19a868ee97aa30c1ac3143..c752deb389730ae56c25888e6b82c89e30060ec9:/modules/Config/DevEdit.pm?ds=inline diff --git a/modules/Config/DevEdit.pm b/modules/Config/DevEdit.pm index e423819..4077b30 100644 --- a/modules/Config/DevEdit.pm +++ b/modules/Config/DevEdit.pm @@ -5,8 +5,8 @@ package Config::DevEdit; # # Read and parse the configuration files # -# Author: Patrick Canterino -# Last modified: 2004-04-25 +# Author: Patrick Canterino +# Last modified: 2004-11-24 # use strict; @@ -24,7 +24,7 @@ use base qw(Exporter); # # Read the configuration files of Dev-Editor # -# Params: Path to configuration file +# Params: Path to main configuration file # # Return: Configuration (Hash Reference) @@ -42,7 +42,7 @@ sub read_config($) # parse_config() # -# Parse an INI-style configuration file +# Parse a configuration file # # Params: Path to configuration file # @@ -53,7 +53,7 @@ sub parse_config($) my $file = shift; local *CF; - open(CF,"<$file") or croak("Open $file: $!"); + open(CF,"<".$file) or croak("Open $file: $!"); read(CF, my $data, -s $file); close(CF); @@ -69,10 +69,10 @@ sub parse_config($) # Remove whitespaces at the beginning and at the end - $key =~ s/^\s*//g; - $key =~ s/\s*$//g; - $value =~ s/^\s*//g; - $value =~ s/\s*$//g; + $key =~ s/^\s+//g; + $key =~ s/\s+$//g; + $value =~ s/^\s+//g; + $value =~ s/\s+$//g; croak "Double defined value '$key' in configuration file '$file'" if($config->{$key});