X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FInifile.pm;h=6895d6030b5c2b15502be359505d7aca93ea9036;hb=72be9c763f3b7f7df1fae4fe10011e45f9e2ad1d;hp=aadec0af1fe6572ec7209e268a9ff79ba1a85244;hpb=a52a1004576857c1c1539b241aae1adab0b242b0;p=kivitendo-erp.git diff --git a/SL/Inifile.pm b/SL/Inifile.pm index aadec0af1..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; @@ -54,12 +56,16 @@ sub new { while () { 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 $_; @@ -84,7 +90,7 @@ sub new { } close FH; - $main::lxdebug->leave_sub(); + $main::lxdebug->leave_sub(2); return bless $self, $type; }