Article View: news.software.nntp
Article #14311Re: INN 1.5.1 "pgpverify" - broken?
From: bill davidsen
Date: Wed, 22 Jan 1997 00:00
Date: Wed, 22 Jan 1997 00:00
108 lines
2322 bytes
2322 bytes
In article <5c19ls$jk2$1@jimsun.uucp>, Jim Seymour <jimsun!jseymour@medar.com> wrote: | I know nothing of perl, so please bear with me on the following... | | There I was, going along merrily, following the README.pgp | instructions when: | | $ pgpverify </tmp/sample.control | /^.*/)/: unmatched () in regexp at pgpverify line 23. | $ | | Huh? So I take a look at pgpverify and find... | | $0 =~ s(^.*/)(); # trim /path/to/prog to prog | | Now that doesn't look to me like any kind of balanced regular | expression *I've* ever seen but, like I said, Jim don't know | perl. So I take a look at the manual page. Hmmm... The | manual page for perl *seems* to indicate that perl's regex | syntax is pretty-much like all the other regex syntax I've | seen before. So I change the offending line to read: | | $0 =~ s/^.*\///; # trim /path/to/prog to prog | | And it's fixed! It was written by someone who has learned to write tricky code by not how to write readable code. Actually, since even old versions allow delimiters other then / with the s operator, you could write something like s@.*/@@ and avoid any visual confusion with the escaped / as a delimiter. I have no idea why this "feature" was added in v5, but it certainly buys no functionality here, and at the expense of using a feature not documented in the most common reference. Oh well, another "learning experience." -- -bill davidsen (davidsen@tmr.com) "As a software development model, Anarchy does not scale well." -Dave Welch
Technical Details
Message-ID:
<5c67o0$40la@usenet1y.prodigy.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<5c19ls$jk2$1@jimsun.uucp>Show Full Headers
Complete Article Headers
Message-ID: <5c67o0$40la@usenet1y.prodigy.net> Subject: Re: INN 1.5.1 "pgpverify" - broken? Date: Wed, 22 Jan 1997 00:00:00 +0000 From: davidsen@tmr.com (bill davidsen) References: <5c19ls$jk2$1@jimsun.uucp> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 211644210 Organization: TMR Associates, Schenectady NY Newsgroups: news.software.nntp Originator: davidsen@darkstar.prodigy.com