🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #38904

Re: Appending signatures - the algorithm (Re: What's in a signature?)

#38904
From: John Moreno
Date: Thu, 19 Feb 1998 00:00
63 lines
2571 bytes
In comp.sys.mac.comm Sven Guckes <guckes@math.fu-berlin.de> wrote:

> gberigan@cse.unl.edu (Greg Berigan):
> > Can't be having two instances of the canonical signature delimiter
> > appearing. Add to that: translating any lines therein of "-- \n" to
> > "--\n"
> 
> OK, new version of the add-sig algorithm then:
> 
> # Add signature to email or post:
> sigfile := $HOME/.signature
> if sigfile does not exist
> then die "sigfile does not exist"
> else
>   read first paragraph of sigfile # no empty lines in sigs!
>   if sigfile is empty
>   then die "sigfile start with empty line(s)"
>   else 
>     remove all sigdashes lines from sigfile
>     if sigfile empty
>     then die "sig contains only sigdashes lines"
>     else 
>       append sigdashes
>       append first four lines of sigfile
>     end
>   end
> end
> 
> Now, is this correct?  Anything missing?
> If so - can anyone convert this to Perl?


$sig = "-- \nJohn Moreno\n-- \nline 3\nline 4\nline 5\nline 6";

#$sigfile="sigfile";
#open (SIGFILE"<$sigfile") || die "sigfile doesn't exist";
#undef $/;
#$sig=<SIGFILE>;

# remove the pound sign and replace sigfile with the real name and path

$sig=~s/(--)( )?(\n)?//gs;

die "sig is empty or only contains sigdashes lines" if ($sig eq "");


#print "==$sig==\n";

$sig=~s/(.*\n.*\n.*\n.*\n)(.|\n)*/$1/;

$sig="-- \n$sig";

print "$sig\n";

# not sure what to do instead of this

# lines not limited to 80 chars

-- 
John Moreno

Technical Details
Message-ID: <4C2B5B36C4A74120.165DA3C921DFC3D6.DAD7A4C8728C7272@library-proxy.airnews.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.sys.mac.comm.mbox.zip!not-for-mail
References: <slrn6epdiv.n3a.guckes@rudin.math.fu-berlin.de>

Show Full Headers
Complete Article Headers
Message-ID: <4C2B5B36C4A74120.165DA3C921DFC3D6.DAD7A4C8728C7272@library-proxy.airnews.net>
Subject: Re: Appending signatures - the algorithm (Re: What's in a signature?)
Date: Thu, 19 Feb 1998 00:00:00 +0000
From: phenix@interpath.com (John Moreno)
References: <slrn6epdiv.n3a.guckes@rudin.math.fu-berlin.de>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.sys.mac.comm.mbox.zip!not-for-mail
X-Deja-AN: 326786298
X-Orig-Message-ID: <1d4ps79.eo1cehdtbbcwN@roxboro0-038.dyn.interpath.net>
Mail-Copies-To: never
NNTP-Posting-Time: Thu Feb 19 19:42:05 1998
X-Face: $!7l?58&Lro>GQtr;A/P^'38=7{P[jPy/?JF*m`Z2&~@3:P3L81Sa7RQ=Y~o| ?'D1cB]L9V=\OS(\8S,5
X-A-Notice: References line has been trimmed due to 512 byte limitation
Organization: phenix@interpath.com
X-FAQs-Read: perl, pascal.mac
NNTP-Proxy-Relay: library.airnews.net
Newsgroups: comp.sys.mac.comm,news.software.readers