Kalkulator in Einkaufsrechnungen noch nicht einbinden
[kivitendo-erp.git] / SL / Inifile.pm
index aadec0a..6895d60 100644 (file)
@@ -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 (<FH>) {
     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;
 }