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;
my $self = { "FILE" => $file };
- open FH, "$file" or Form->error("$file : $!");
+ open FH, "$file" or $::form->error("$file : $!");
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 $_;
}
close FH;
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return bless $self, $type;
}
my ($self) = @_;
my $file = $self->{FILE};
- my $fh = IO::File->new($file, "w") || Form->error("$file : $!");
+ my $fh = IO::File->new($file, "w") || $::form->error("$file : $!");
foreach my $section_name (sort keys %{ $self }) {
next if $section_name =~ m/^[A-Z]+$/;
}
1;
-