<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>In The Box - Latest Comments in One config file to rule them all</title><link>http://inthebox.disqus.com/</link><description></description><language>en</language><lastBuildDate>Mon, 29 Sep 2008 01:41:26 -0000</lastBuildDate><item><title>Re: One config file to rule them all</title><link>http://inthebox.webmin.com/one-config-file-to-rule-them-all#comment-2723748</link><description>This was a great read. Thanks for writing it!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">mrxinu</dc:creator><pubDate>Mon, 29 Sep 2008 01:41:26 -0000</pubDate></item><item><title>Re: One config file to rule them all</title><link>http://inthebox.webmin.com/one-config-file-to-rule-them-all#comment-1606289</link><description>I had a similar issue to overcome, this is my solution, with slightly less overheads...&lt;br&gt;&lt;br&gt;&lt;a href="http://www.hm2k.com/posts/storing-mysql-database-settings-for-php-and-perl-in-one-file" rel="nofollow"&gt;http://www.hm2k.com/posts/storing-mysql-databas...&lt;/a&gt;&lt;br&gt;&lt;br&gt;It's mainly for use with PHP and Perl, but might work in other languages.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">HM2K</dc:creator><pubDate>Mon, 07 Apr 2008 15:22:50 -0000</pubDate></item><item><title>Re: One config file to rule them all</title><link>http://inthebox.webmin.com/one-config-file-to-rule-them-all#comment-1606288</link><description>You're right, Christian.  The editor in Wordpress is hateful and "corrects" certain characters, even when they're wrapped in pre tags.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">SwellJoe</dc:creator><pubDate>Wed, 12 Dec 2007 19:12:10 -0000</pubDate></item><item><title>Re: One config file to rule them all</title><link>http://inthebox.webmin.com/one-config-file-to-rule-them-all#comment-1606287</link><description>Hi,&lt;br&gt;&lt;br&gt;the perl should read:&lt;br&gt;&lt;br&gt;###&lt;br&gt;my $file = "apache.config";&lt;br&gt;open(CONFIG, "&amp;lt; $file") or die "can't open $file: $!";&lt;br&gt;my %config = map {&lt;br&gt;      s/#.*//; # Remove comments&lt;br&gt;      s/^\s+//; # Remove opening whitespace&lt;br&gt;      s/\s+$//;  # Remove closing whitespace&lt;br&gt;      m/(.*?)\s*=\s*(.*)/; }&lt;br&gt;      ;&lt;br&gt; &lt;br&gt;# Print it out&lt;br&gt;use Data::Dumper;&lt;br&gt;print Dumper(\%config);&lt;br&gt;###&lt;br&gt;&lt;br&gt;###&lt;br&gt;my $file = "apache.config";&lt;br&gt;open(CONFIG, "&amp;lt; $file") or die "can't open $file: $!";&lt;br&gt;while () {&lt;br&gt;    chomp;&lt;br&gt;    s/#.*//; # Remove comments&lt;br&gt;    s/^\s+//; # Remove opening whitespace&lt;br&gt;    s/\s+$//;  # Remove closing whitespace&lt;br&gt;    next unless length;&lt;br&gt;    my ($key, $value) = split(/\s*=\s*/, $_, 2);&lt;br&gt;    $config{$key} = $value;&lt;br&gt;}&lt;br&gt; &lt;br&gt;# Print it out&lt;br&gt;use Data::Dumper;&lt;br&gt;print Dumper(\%config);&lt;br&gt;###&lt;br&gt;&lt;br&gt;&lt;br&gt;Christian</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Christian</dc:creator><pubDate>Sun, 25 Nov 2007 05:48:35 -0000</pubDate></item><item><title>Re: One config file to rule them all</title><link>http://inthebox.webmin.com/one-config-file-to-rule-them-all#comment-1606286</link><description>man, i read the entire thing thinking about webmin, probably because it was in the intro.  didn't even put 2 and 2 together.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">paul</dc:creator><pubDate>Thu, 11 Oct 2007 01:25:12 -0000</pubDate></item></channel></rss>