All pastes #92716 Raw Edit

Miscellany

public text v1 · immutable
#92716 ·published 2006-07-19 21:08 UTC
rendered paste body
#!/usr/bin/perl
use CGI;
use POSIX qw(strftime);
use XML::RSS;
use Getopt::Long;

my %CONFIG;
if (open(CONF, "/etc/rssgen.conf")) {
  while ($line = <CONF>) {
    chomp ($line);
    if ($line =~ /^\s*\#/) { next; }
    if ($line =~ /^\s*(\w+)\s*=\s*(.*)\s*$/) { $CONFIG{$1} = $2; }
  }
 } else {
   die("Unable to open config file -- $!\n");
 }