Article View: news.software.nntp
Article #84144Re: Cleanfeed and headers.
From: Ralf Döblitz
Date: Sat, 25 Jun 2011 16:00
Date: Sat, 25 Jun 2011 16:00
25 lines
2600 bytes
2600 bytes
D. Stussy <spam+newsgroups@bde-arc.ampr.org> wrote:
> As I understand how headers are stored under perl and the cleanfeed filter,
> it's an associative array, with the header name as the "index."
Usually this is called a "hash".
> However,
> does that permit an easy way to determine whether a header exists when
> using a regex to match the header name, not knowing the specific header
> name in advance? All I can think of is a loop cycling through the array,
> testing for a match one at a time. Perl is known for efficiency better
> than that, so is there a better way?
You can get a list of all hash keys with
keys %whatever_your_hash_is_named
and thus can subsequently filter this list with
grep { /you_regex/ }
rendering a list of matching hash keys which can then be processed any
way you like (count it, e.g.).
Ralf
--
Eine GABELN heißt im Fido nämlich "Echo", weil da reingegatete Artikel
öfters mit anderer Message-ID wieder rauskommen.
– Oliver B. Warzecha
Technical Details
Message-ID:
<iu50nm$ktp$1@selene.doeblitz.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.20141118.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin1!goblin.stu.neva.ru!newsfeed.straub-nv.de!uucp.gnuu.de!doeblitz.net!.POSTED!not-for-mailReferences:
<iu1bv3$o9b$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <iu50nm$ktp$1@selene.doeblitz.net>
Subject: Re: Cleanfeed and headers.
Date: Sat, 25 Jun 2011 16:00:54 +0000
From: Ralf Döblitz <doeblitz@doeblitz.net>
References: <iu1bv3$o9b$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!num2.nntp.dca.giganews.com!num1.nntp.dca.giganews.com!number.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin2!goblin1!goblin.stu.neva.ru!newsfeed.straub-nv.de!uucp.gnuu.de!doeblitz.net!.POSTED!not-for-mail
Newsgroups: news.software.nntp
Organization: private site in Braunschweig, Germany
Lines: 25
NNTP-Posting-Host: selene.escape.de
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: selene.doeblitz.net 1309017654 21433 194.120.234.83 (25 Jun 2011
X-Complaints-To: usenet@selene.doeblitz.net
NNTP-Posting-Date: Sat, 25 Jun 2011 16:00:54 +0000 (UTC)
User-Agent: tin/1.9.6-20100522 ("Lochruan") (UNIX) (Linux/2.6.32-5-xen-amd64
(x86_64))
Cancel-Lock: sha1:ickXEOV8rQs42pl6HGSoMbM9uWc=
Mail-Copies-To: nobody
X-Face: MTa[OP$pr;
PqMc)e|d9BmnYq|Ir0`Ijj)kNr"C:9lS:bjC1P`Y>eWC41xS,XF96GoZH8WOl
^L#i6KSohA`[`_P->X=Q|g?{H{B):V5>&z"M>njIRGN:5"VBu,OLOe%v6\{@iS
X-Alignment: Lawful Evil
X-No-Archive: Yes
X-Archive: http:/www.netzverwaltung.net/archive/_outgoing/