use strict;
# htag.pl - a tagline generator, sig manager and over engineered program.
-# Copyright (C) 1999-2001 Simon Huggins
+# Copyright (C) 1999-2003 Project Purple, Simon Huggins
# Simon Huggins <huggie@earth.li>
# http://www.earth.li/projectpurple/progs/htag.html
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
-# Software Foundation; either version 2 of the License, or (at your option)
-# any later version.
+# Software Foundation; version 2 of the License only
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# HtagPlugin lying around the system then uncomment the following with the
# path to your local copy of HtagPlugin
-# use lib '/home/huggie/htag/';
+# use lib '/home/huggie/perl/huggietag/htag-0.0.24/HtagPlugin';
-use HtagPlugin 0.5;
+use HtagPlugin 0.6;
use Getopt::Long;
use POSIX qw/tcgetpgrp/;
my $infinity = 80;
### Defines
-$override{'VERSION'} = $cfg{'VERSION'} = "0.0.19";
+$override{'VERSION'} = $cfg{'VERSION'} = "0.0.24";
$override{'HOME'} = $cfg{'HOME'} = $ENV{"HOME"} || $ENV{"LOGDIR"}
|| (getpwuid($<))[7];
+$cfg{'nicedie'} = 1;
# srand(time() ^ ($$ + ($$ << 15) )); # Since 5.004 not required
-#sub nicedie($) {
-# my $msg = shift;
-# warn $msg;
-# if ($cfg{'nicedie'}) {
-# warn "Press <RETURN> to continue\n";
-# my $throwaway=<STDIN>;
-# }
-# die "\n";
-#}
-
sub print_header {
print STDERR "Htag.pl $cfg{'VERSION'} - Simon Huggins <huggie\@earth.li> Released under GPL\n";
- print STDERR "Copyright (C) 1999-2001 Project Purple. http://www.earth.li/projectpurple/\n\n";
+ print STDERR "Copyright (C) 1999-2002 Project Purple. http://www.earth.li/projectpurple/\n\n";
}
sub process_options {
"msgfile=s" => \$cfg{'msgfile'},
"m=s" => \$cfg{'msgfile'});
if (not &GetOptions(%getopt)) {
- print <<'EOF';
+ print STDERR <<'EOF';
htag.pl - tagline and general sig adder.
Usage: htag.pl -t tagfile -c cfgfile -m msgfile
htag.pl -h gives perldoc
my $file;
if (defined $cfg{'changeheaders'}) {
- open(HANDLE, $cfg{'msgfile'});
my (@headers,$match,@l);
- while (my $line = <HANDLE>) {
- last if ($line =~ /^$/); # end of headers
- push @headers, $line;
+ if (open(HANDLE, $cfg{'msgfile'})) {
+ while (my $line = <HANDLE>) {
+ last if ($line =~ /^$/); # end of headers
+ push @headers, $line;
+ }
+ close(HANDLE);
}
foreach (@{$cfg{'changeheaders'}}) {
$file = pop;
}
}
- close(HANDLE);
}
}