3 # Copyright (C) 2000-2003 Simon Huggins
4 # header adds headers to messages like "Hi @F"
6 # This program is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by the Free
8 # Software Foundation; either version 2 of the License, or (at your option)
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc., 59
18 # Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 return if (not defined $cfg{'randhead'});
30 open(HANDLE,$msgfile) or htagdie "$0: Cannot open $msgfile: $!\n";
34 my $head = @{$cfg{'randhead'}}[rand scalar @{$cfg{'randhead'}}];
35 $head = subst_macros($head);
38 for ($i=0; $i<scalar @msg; $i++) {
39 next if $msg[$i] =~ /^.*:/;
40 next if $msg[$i] =~ /^[ ]/;
44 $msg[$i] = $msg[$i] . $head . "\n";
46 open(HANDLE, ">$msgfile") or htagdie "$0: Cannot open $msgfile: $!\n";
52 process_msgbody $cfg{'msgfile'};
53 add_heading $cfg{'msgfile'} if defined $cfg{'name'};