]> the.earth.li Git - htag.git/blob - plugins/35tearline
Import Upstream version 0.0.23
[htag.git] / plugins / 35tearline
1 #!/usr/bin/perl -w
2
3 # Copyright (C) 2000-2003 Simon Huggins
4 # tearline is a hang over from Fidonet days where tagline adding programs
5 # had tearlines.  It's probably no longer used by anyone anywhere but well I
6 # live in hope that Fidonet will be reborn...
7
8 # This program is free software; you can redistribute it and/or modify it
9 # under the terms of the GNU General Public License as published by the Free
10 # Software Foundation; either version 2 of the License, or (at your option)
11 # any later version.
12 #
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 # or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
16 # for more details.
17 #
18 # You should have received a copy of the GNU General Public License along
19 # with this program; if not, write to the Free Software Foundation, Inc., 59
20 # Temple Place, Suite 330, Boston, MA 02111-1307  USA
21
22 use strict;
23
24 my $sig;
25
26 open(SIG, "<$cfg{'tmpsigfile'}") or htagdie "$0: Cannot open $cfg{'tmpsigfile'}: $!\n";
27 while(<SIG>) {
28         $sig .= $_;
29 }
30 close(SIG);
31
32 my @tears = @{$cfg{'randtear'}};
33 if ($_ = $cfg{'tearline'}) {
34         /short/i and $sig .= "$cfg{'pretear'} Htag.pl $cfg{'VERSION'}";
35         /long/i and  $sig .= "$cfg{'pretear'} Htag.pl $cfg{'VERSION'} - $tears[rand(@tears)]";
36         open(SIG, ">$cfg{'tmpsigfile'}") or htagdie "$0: Cannot open $cfg{'tmpsigfile'}: $!\n";
37         print SIG $sig;
38         close(SIG);
39 }
40 return;