X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=htag.pl;h=898e88ca9919bab83779313aa0d7c376a339992f;hb=HEAD;hp=235afef1d0f01f39bd16a4c5868b5325a0ab7c0f;hpb=05869f1bf3fb39b81155235901cae1ba99b9b359;p=htag.git diff --git a/htag.pl b/htag.pl index 235afef..898e88c 100755 --- a/htag.pl +++ b/htag.pl @@ -3,7 +3,7 @@ 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 # http://www.earth.li/projectpurple/progs/htag.html @@ -12,8 +12,7 @@ use strict; # 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 @@ -35,9 +34,9 @@ if ($< == 0 or $> == 0 or $( == 0 or $) == 0) { # 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/; @@ -57,25 +56,16 @@ my $cfgdebug=0; 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 to continue\n"; -# my $throwaway=; -# } -# die "\n"; -#} - sub print_header { print STDERR "Htag.pl $cfg{'VERSION'} - Simon Huggins 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 { @@ -97,7 +87,7 @@ 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 @@ -349,11 +339,13 @@ sub choose_configfile() { my $file; if (defined $cfg{'changeheaders'}) { - open(HANDLE, $cfg{'msgfile'}); my (@headers,$match,@l); - while (my $line = ) { - last if ($line =~ /^$/); # end of headers - push @headers, $line; + if (open(HANDLE, $cfg{'msgfile'})) { + while (my $line = ) { + last if ($line =~ /^$/); # end of headers + push @headers, $line; + } + close(HANDLE); } foreach (@{$cfg{'changeheaders'}}) { $file = pop; @@ -391,7 +383,6 @@ sub choose_configfile() { } } - close(HANDLE); } }