Thread View: news.software.nntp
4 messages
4 total messages
Started by Andrew Cormack - COMPG
Mon, 18 Aug 1997 00:00
Help with Perl hooks on INN 1.5.1, please
Author: Andrew Cormack - COMPG
Date: Mon, 18 Aug 1997 00:00
Date: Mon, 18 Aug 1997 00:00
33 lines
2195 bytes
2195 bytes
I'm trying to write a Perl filter_nnrpd.pl program which will check
that the headers on locally posted news articles contain valid return
mail addresses. This is working fine, except when I try to attach to
the DBM file which contains the list of valid addresses, the following
appears in the news.notice log file:
nnrpd[6075]: Perl function filter_post died: AnyDBM_File doesn't define \
a TIEHASH method at /usr/news/bin/control/filter_nnrpd.pl line 120
nnrpd[6075]: peth.comp.cf.ac.uk perl filtering disabled
The offending code seems to be a call to dbmopen(), since the filter works
fine if I comment that out. However if I write a main program to call the
filtering routine, and run that on its own on the same machine, it works
fine, even with the dbmopen() call.
I'd be very grateful for any suggestion what the difference might be
between running my routine stand-alone and as a INN subroutine,
especially if someone can suggest what I need to add to my program to
make it work. This is Perl 5.004, by the way.
Thanks,
Andrew
--
+-----------------------------------------------------------------+
| Andrew Cormack | email: cormack@cardiff.ac.uk |
| Information Systems Support, | snail: 40/41 Park Place, Cardiff |
| postmaster and webmaster | CF1 3BB |
| University of Wales, Cardiff | |
+-----------------------------------------------------------------+
Re: Help with Perl hooks on INN 1.5.1, please
Author: Stan A. Rogge
Date: Tue, 02 Sep 1997 00:00
Date: Tue, 02 Sep 1997 00:00
18 lines
1294 bytes
1294 bytes
Perl 5 does not use dbmopen and dbmclose. It uses tie and untie. Also, you must define the type dbm you are using. Here is an example: use SDBM_File; tie(%SITES, SDBM_File, $config_file, O_RDWR | O_CREAT, 0660); untie %SITES; $config_file is the base name of the dbm filename. %SITES is the associative array name Get thee a perl5 book. Xref: news.mr.net tw.bbs.rec.model:6740 s Analyst) srogge@telsarpc.harmonic.com Harmonic System Incorporated, 701 Fourth Avenue South, Suite 320, Minneapolis MN 55415 Telephone: 612-321-4060 Fax- 612-672-3549 Web: http://www.telsarpc.harmonic.com FTP: ftp://telsarpc.harmonic.com
Re: Help with Perl hooks on INN 1.5.1, please
Author: Garzik
Date: Tue, 02 Sep 1997 00:00
Date: Tue, 02 Sep 1997 00:00
24 lines
1271 bytes
1271 bytes
In article <01bcb753$2df794a0$fc01fd0a@telsarlt.harmonic.com>, Stan A. Rogge <srogge@telsarpc.harmonic.com> wrote: >Perl 5 does not use dbmopen and dbmclose. It uses tie and untie. Also, >you must define the type dbm you are using. Here is an example: > >use SDBM_File; >[...] You cannot use dbmopen, nor tie, without patching innd and nnrpd to allow the use of the "use" clause. Note that Perl 5 *does* use dbmopen and dbmclose, they are merely aliases to tie and untie, for the AnyDBM module. Jeff -- Often statistics are used as a drunken man uses lampposts -- for support rather than illumination.
Re: Help with Perl hooks on INN 1.5.1, please
Author: Eric D. Friedman
Date: Wed, 03 Sep 1997 00:00
Date: Wed, 03 Sep 1997 00:00
14 lines
1092 bytes
1092 bytes
In article <01bcb753$2df794a0$fc01fd0a@telsarlt.harmonic.com>, Stan A. Rogge <srogge@telsarpc.harmonic.com> wrote: <Perl 5 does not use dbmopen and dbmclose. It uses tie and untie. Also, <you must define the type dbm you are using. Here is an example: So how come the new Llama book still uses 'em? I'm confused. Eric -- Eric D. Friedman friedman@uci.edu
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads