🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #9400

Re: need help with script to add new newsgroup

#9400
From: Harry Bochner
Date: Wed, 17 Jul 1996 00:00
35 lines
1713 bytes
In article <1996Jul15.173644.24474@cbgate.cbc.com>, marshald@cbc.com (Dion Marshall) writes:
|> If I remember my PERL correctly, the comma between "newgroup" and $name in
|> a system statement is replaced with a "return" by default.

No, actually.
The problem is that the input line contains a LF character to start with,
and the "split" operation leaves it in the $newgroup variable.
Adding the command
chop;
before the split should solve the problem.

|> Change it to:
|> 	system ctlinnd, "newgroup ".$name;
|> "Dot" is the concatination operator.

This passes 'newgroup xyz\n' to ctlinnd as a single argument, and gets
the following response from ctlinnd
> Usage error (unknown command) -- try -h for help.

You could use
system "ctlinnd newgroup $name";

If there's only one scalar argument to system(), perl splits that argument
into words, and that gives the right results.
(Even if the name contains a \n, as I just determined by the experimental
method ;-)

Hope this helps,

-- 
Harry Bochner
bochner@das.harvard.edu

Technical Details
Message-ID: <4sjc0b$pb4@necco.harvard.edu>
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
References: <31E545DC.3515@nav.cc.tx.us> <1996Jul15.173644.24474@cbgate.cbc.com>

Show Full Headers
Complete Article Headers
Message-ID: <4sjc0b$pb4@necco.harvard.edu>
Subject: Re: need help with script to add new newsgroup
Date: Wed, 17 Jul 1996 00:00:00 +0000
From: bochner@das.harvard.edu (Harry Bochner)
References: <31E545DC.3515@nav.cc.tx.us> <1996Jul15.173644.24474@cbgate.cbc.com>
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: 169299852
Sender: bochner@das (Harry Bochner)
Organization: Aiken Computation Lab, Harvard University
Newsgroups: news.software.nntp