#! /usr/bin/perl -W
#
-# yapfaq Version 0.7 by Thomas Hochstein
+# yapfaq Version 0.8.1 by Thomas Hochstein
# (Original author: Marc Brockschmidt)
#
# This script posts any project described in its config-file. Most people
# It can be redistributed and/or modified under the same terms under
# which Perl itself is published.
-our $VERSION = "0.8-prelease";
+our $VERSION = "0.9-prelease";
# Please do not change this setting!
# You may override the default .rc file (.yapfaqrc) by using "-c .rc file"
warn "$0: W: .rc file $RCFile does not exist!\n";
}
-$Options{'s'} = $Config{'Program'} if (!defined($Options{'s'}));
+$Options{'s'} = $Config{'Program'} if (defined($Config{'Program'}) && $Config{'Program'} && !defined($Options{'s'}));
# read configuration (configured FAQs)
my @Config;
s/\r//;
push (@Body, $_), next if $InRealBody;
$InRealBody++ if /^$/;
- $LastModified = $1 if /^Last-modified: (\S+)$/i;
+ $LastModified = $1 if /^Last-modified:\s*(\S+)\s*$/i;
push @Body, $_;
}
close FH;
#Replace %LM by the content of the news.answer-pseudo-header Last-modified:
if ($LastModified) {
$$Subject =~ s/\%LM/$LastModified/;
+ } else {
+ $$Subject =~ s/[<\[{\(]?\%LM[>\]}\)]?//;
}
# Test mode?