X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FInifile.pm;h=6895d6030b5c2b15502be359505d7aca93ea9036;hb=738c240ad3a167dd3013ef01f0892b5589fd7d9a;hp=f7fe27b3c60fd7afa3c0bdee0a6f616f97dc663b;hpb=db53dc8ab328b82c7af17896487674ad98f2af6b;p=kivitendo-erp.git diff --git a/SL/Inifile.pm b/SL/Inifile.pm index f7fe27b3c..6895d6030 100644 --- a/SL/Inifile.pm +++ b/SL/Inifile.pm @@ -37,10 +37,12 @@ package Inifile; use IO::File; +use strict; + sub new { - $main::lxdebug->enter_sub(); + $main::lxdebug->enter_sub(2); - my ($type, $file) = @_; + my ($type, $file, %options) = @_; my $id = ""; my $skip; @@ -52,16 +54,18 @@ sub new { open FH, "$file" or Form->error("$file : $!"); while () { - next if m/^(#|;|\s)/; - chomp; - # strip comments - s/(#|;).*//g; + if (!$options{verbatim}) { + # strip comments + s/\#.*//; - # remove any trailing whitespace - s/^\s*//; - s/\s*$//; + # remove any trailing whitespace + s/^\s*//; + s/\s*$//; + } else { + next if (m/^\s*\#/); + } next unless $_; @@ -86,7 +90,7 @@ sub new { } close FH; - $main::lxdebug->leave_sub(); + $main::lxdebug->leave_sub(2); return bless $self, $type; }