🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #219265

Re: PNews update

#219265
From: Mats Peterson
Date: Tue, 15 Apr 2008 12:48
84 lines
4477 bytes
"Gerry Ford" <gerry@nowhere.ford> wrote:
>
> "Mats Peterson" <matsp555@yahoo.com> wrote in message 
> news:0iYMj.6088$R_4.4506@newsb.telia.net...
>> "Gerry Ford" <gerry@nowhere.ford> wrote:
>>>
>>> "Mats Peterson" <matsp555@yahoo.com> wrote in message
>>> news:tDEMj.6037$R_4.4831@newsb.telia.net...
>>>> "Gerry Ford" <gerry@nowhere.ford> wrote:
>>>>>
>>>
>>>>> My question for Mats has to do with the use statements in his client:
>>>>> use strict;
>>>>> use Net::NNTP;
>>>>> use Net::SMTP;
>>>>> use HTTP::Date qw/time2str str2time/;
>>>>> use MIME::QuotedPrint qw/encode_qp decode_qp/;
>>>>> use Encode qw/encode decode/;
>>>>> use POSIX qw/strftime/;
>>>>> use File::stat;
>>>>> use File::Temp qw/:mktemp/;
>>>>> use Win32::ANSIConsole qw/coninit cls/;
>>>>>
>>>>> I believe for perl.exe to know what I'm talking about, I would have to
>>>>> download these modules.  This isn't as sraightforward as I would like
>>>>> with
>>>>> windows, but for a guy at my skill level, I think I could marshall 
>>>>> these
>>>>> together.  My question goes to this syntax that follows the plain 
>>>>> vanilla
>>>>> "use" statement:
>>>>>
>>>>> use File::Temp qw/:mktemp/;
>>>>> ^^^^^^^^
>>>>>
>>>>> What does it mean?
>>>>
>>>> This is explained in the Exporter documentation, which can be viewed
>>>> with the command `perldoc Exporter'. Check the "How to Import" section.
>>> I tuned up on the import syntax.  AS perl has no idea what, e.g.,
>>> Win32::ANSIConsole is.
>>
>> It's all in the README.txt file, including the fact that this module is
>> available at http://www.geocities.com/matsp888/windows/lib/.
>>
>> Unzip it and place the contents somewhere where Perl looks for modules,
>> \Perl\site\lib etc.
> Thanks, Mats.  I think I have what I need to move forward after I catch 40 
> winks.
>
> One question that I'd like to know from the author.  What is so special 
> about coninit that you go through all this to define it:
> package Win32::ANSIConsole;
>
> use strict;
> use warnings;
> use Win32::Console::ANSI qw/SetConsoleSize Title/;
>
> require Exporter;
> our @ISA = qw(Exporter);
> our %EXPORT_TAGS = ('const' => [qw(BOLD UNDER BLINK REVERSE
>     BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE
>     BBLACK BRED BGREEN BYELLOW BBLUE BMAGENTA BCYAN BWHITE)]);
> our @EXPORT_OK = (@{$EXPORT_TAGS{'const'}}, qw(coninit title attr cls
>         clreol curpos));
>
> What would happen if you removed it?

Not much. The main thing coninit does is calling SetConsoleSize() in
Win32::ANSI::Consol to set the screen buffer size to 80x25 (hardcoded,
I know, but it's the "standard").
Regarding the extra stuff up there, I wanted to have the most common
ANSI stuff - like color constants, and some handy shortcut functions
like 'cls' instead of having to type the escapes literally - in one
module.

This program is probably more geared toward people with some Unix
knowledge than the usual "click to install" folks. Not to say one
is better than the other. I moved from Unix to Windows myself, 
because I use software that simply doesn't exist in Unix.

-- 
Mats Peterson
http://www.geocities.com/matsp888/
Technical Details
Message-ID: <iu1Nj.6099$R_4.4843@newsb.telia.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!club-internet.fr!feedme-small.clubint.net!proxad.net!feeder1-1.proxad.net!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail
References: <FQjMj.5999$R_4.4766@newsb.telia.net> <1208149449_40983@news.newsgroups.com> <tDEMj.6037$R_4.4831@newsb.telia.net> <1208237675_7@news.newsgroups.com> <0iYMj.6088$R_4.4506@newsb.telia.net> <1208249980_13@news.newsgroups.com>

Show Full Headers
Complete Article Headers
Message-ID: <iu1Nj.6099$R_4.4843@newsb.telia.net>
Subject: Re: PNews update
Date: Tue, 15 Apr 2008 12:48:14 GMT
From: Mats Peterson <matsp555@yahoo.com>
References: <FQjMj.5999$R_4.4766@newsb.telia.net> <1208149449_40983@news.newsgroups.com> <tDEMj.6037$R_4.4831@newsb.telia.net> <1208237675_7@news.newsgroups.com> <0iYMj.6088$R_4.4506@newsb.telia.net> <1208249980_13@news.newsgroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!club-internet.fr!feedme-small.clubint.net!proxad.net!feeder1-1.proxad.net!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail
Newsgroups: news.software.readers
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: PNews
Lines: 84
NNTP-Posting-Host: 213.64.75.194
X-Complaints-To: abuse@telia.com
X-Trace: newsb.telia.net 1208263694 213.64.75.194 (Tue,
NNTP-Posting-Date: Tue, 15 Apr 2008 14:48:14 CEST
Organization: Telia Internet