use strict; use Data::Dumper; my (undef, @conf) = split ($/, " " ); my $conf = MyConfig::General->new(\@conf); print Dumper {$conf->getall}; package MyConfig::General; use base 'Config::General'; sub _open { my ( $this, $arrayref ) = @_; my ( @content, $c_comment, $longline, $hier, $hierend, @hierdoc ); local $_; for (@$arrayref) { chomp; if ( !$hierend ) { s/(?{content} }, $hier; @hierdoc = (); undef $hier; undef $hierend; } elsif (/^\s*\/\*/) { if (/\*\/\s*$/) { $c_comment = 0; } else { $c_comment = 1; } } elsif (/\*\//) { if ( !$c_comment ) { warn "invalid syntax: found end of C-comment without previous start!\n"; } $c_comment = 0; } elsif (/\\$/) { chop; s/^\s*//; $longline .= $_ if ( !$c_comment ); } else { if ($longline) { s/^\s*//; $longline .= $_ if ( !$c_comment ); push @{ $this->{content} }, $longline; undef $longline; } elsif ($hier) { push @hierdoc, $_; } else { if ( !$c_comment ) { my $incl_file; if ( /^\s*<>\s*$/i || ( /^\s*include (.+?)\s*$/i && $this->{UseApacheInclude} ) ) { $incl_file = $1; if ( $this->{IncludeRelative} && $this->{configpath} && $incl_file !~ /^\// ) { $this->_open( $this->{configpath} . "/" . $incl_file ); } else { $this->_open($incl_file); } } else { push @{ $this->{content} }, $_; } } } } } return 1; }