🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #83680

Re: Undefined $user in filter_nnrpd.pl?

#83680
From: Ralf Döblitz
Date: Tue, 16 Nov 2010 07:23
29 lines
2944 bytes
Michael Grimm <trashcan@odo.in-berlin.de> wrote:
[...]
> Well, I did reduce my filter_nnrpd.pl to ...
> ,----
> | use strict;
> | our (%hdr, $modify_headers);
> | sub filter_post {
> |       my $rval = '';
> |       $modify_headers = 1;
> |       INN::syslog('notice',"DEBUG(user): ".$user);
> |       return $rval;
> | }
> `----
> ... and it triggered the error message as cited above. But, when I do
> remove the "use strict;", well, then the filter works as expected ;-)

Ahemm, if you use "use strict" you have to declare all variables that
you use. So you should expand
| our (%hdr, $modify_headers);
to
| our (%hdr, $modify_headers, $user);
and your perl script will not complain about that variable anymore.

Ralf
-- 
Ralf Döblitz   *   Schapenstraße 6   *   38104 Braunschweig   *   Germany
Phone: +49-531-2361223   Fax: +49-531-2361224  mailto:doeblitz@doeblitz.net
Homepage: http://www.escape.de/users/selene/
Mit UTF-8 kann man gleichzeitig äöüßÄÖÜæœłø‱¼½¾¤¹²³¢€£¥¶§¬÷×±©®™¡¿ verwenden…
Technical Details
Message-ID: <ibtbif$835$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!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.158.31.10.MISMATCH!newsfeed-0.progon.net!progon.net!uucp.gnuu.de!doeblitz.net!not-for-mail
References: <ibosfc$24e$1@de-l.enfer-du-nord.net> <nsn.1011141928.3607@thorondor.akallabeth.de> <ibph2a$1ejh$2@de-l.enfer-du-nord.net> <nsn.1011150851.3613@thorondor.akallabeth.de> <ibrplq$nv0$5@de-l.enfer-du-nord.net>

Show Full Headers
Complete Article Headers
Message-ID: <ibtbif$835$1@selene.doeblitz.net>
Subject: Re: Undefined $user in filter_nnrpd.pl?
Date: Tue, 16 Nov 2010 07:23:59 +0000
From: Ralf Döblitz <doeblitz@doeblitz.net>
References: <ibosfc$24e$1@de-l.enfer-du-nord.net> <nsn.1011141928.3607@thorondor.akallabeth.de> <ibph2a$1ejh$2@de-l.enfer-du-nord.net> <nsn.1011150851.3613@thorondor.akallabeth.de> <ibrplq$nv0$5@de-l.enfer-du-nord.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!border1.nntp.ams3.giganews.com!border2.nntp.ams3.giganews.com!border2.nntp.ams2.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!nntp.giganews.com!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!82.197.223.103.MISMATCH!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.158.31.10.MISMATCH!newsfeed-0.progon.net!progon.net!uucp.gnuu.de!doeblitz.net!not-for-mail
Newsgroups: news.software.nntp
Organization: private site in Braunschweig, Germany
Lines: 29
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 1289892239 8293 194.120.234.83 (16 Nov 2010
X-Complaints-To: usenet@selene.doeblitz.net
NNTP-Posting-Date: Tue, 16 Nov 2010 07:23:59 +0000 (UTC)
Cancel-Lock: sha1:e0i2x473FQZsqrRMraGAjzLHq5A=
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/
User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.26-2-amd64
 (x86_64))
X-Original-Bytes: 2779