🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #219947

Re: PNNTP, a simple NNTP client for Windows in Perl

#219947
From: Gerry Ford
Date: Wed, 23 Apr 2008 23:32
62 lines
3788 bytes
"Mats Peterson" <matsp555@yahoo.com> wrote in message 
news:9fCPj.6455$R_4.5181@newsb.telia.net...
> Jernej Simon?i? <jernej@deepthought.ena.invalid> wrote:
>> on Tue, 22 Apr 2008 09:57:37 GMT, Mats Peterson wrote:
>>
>>> I am fully aware of %APPDATA%, but in my book it's not a place to hold
>>> user-edited files.
>>
>> If you're only aiming at home users, this may be acceptable. It 
>> definitely
>> isn't if you aim to ever have your application used in any kind of
>> corporate environment.
>>
>
> I'm obviously not.
Since I'm going in and changing these files all the time, I want them all 
together.  I think if I had a version that I thought was ready for a 
non-perl windows user, I would place them all in a scripts folder that is on 
the same level with the binaries.  Right out of the box, I would include the 
ansi console stuff in appropriate folders as well.  Maybe I should try a 
version that doesn't use it at all ....

Mats, a change for you:

#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper qw( Dumper);

my $killrc = "sample.killrc";
my @filter;
my @list1 = qw( Mon Tu Wed);
    open(FILE, "<$killrc") and do {
        @filter = ();
        foreach (<FILE>) {
            chomp; length or next; /^#/o and next;
            my $pat; eval ('$pat = qr/$_/') or do {prompt $@; next};
            push @filter, $pat;
        };
        close(FILE);

};
print @filter;
print @list1;
#print STDOUT "The list is " . Dumper( @list ) . "\n";

#  perl mats5.pl 2>text50.txt >text51.txt
__END__

As you can see, I'm picking apart your script like a guy in a wheelchair 
running a race.  You want to have parens around what you want to eval.  As 
it is, you're evaluating the do as well.  I've got a stomach flu. :-(
-- 
"Life in Lubbock, Texas, taught me two things: One is that God loves you
and you're going to burn in hell.  The other is that sex is the most
awful, filthy thing on earth and you should save it for someone you love."

~~  Butch Hancock 

Technical Details
Message-ID: <1208993381_3075@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!nx01.iad01.newshosting.com!newshosting.com!38.119.100.149.MISMATCH!out.nntp.be!sp12lax.superfeed.net!not-for-mail
References: <480ce6ec$0$35954$4fafbaef@reader2.news.tin.it> <pan.2008.04.21.19.42.11.636510@thurston.blinkynet.net> <480cf055$0$35952$4fafbaef@reader2.news.tin.it> <pan.2008.04.21.20.37.18.542739@thurston.blinkynet.net> <1208832727_3042@news.newsgroups.com> <NVdPj.6400$R_4.5210@newsb.telia.net> <ot5y7d0a5l61.dlg@deepthought.ena.si> <lEiPj.6420$R_4.5219@newsb.telia.net> <o51cwvw22t1p.dlg@deepthought.ena.si> <9fCPj.6455$R_4.5181@newsb.telia.net>

Show Full Headers
Complete Article Headers
Message-ID: <1208993381_3075@news.newsgroups.com>
Subject: Re: PNNTP, a simple NNTP client for Windows in Perl
Date: Wed, 23 Apr 2008 18:32:04 -0500
From: "Gerry Ford" <gerry@nowhere.ford>
References: <480ce6ec$0$35954$4fafbaef@reader2.news.tin.it> <pan.2008.04.21.19.42.11.636510@thurston.blinkynet.net> <480cf055$0$35952$4fafbaef@reader2.news.tin.it> <pan.2008.04.21.20.37.18.542739@thurston.blinkynet.net> <1208832727_3042@news.newsgroups.com> <NVdPj.6400$R_4.5210@newsb.telia.net> <ot5y7d0a5l61.dlg@deepthought.ena.si> <lEiPj.6420$R_4.5219@newsb.telia.net> <o51cwvw22t1p.dlg@deepthought.ena.si> <9fCPj.6455$R_4.5181@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!nx01.iad01.newshosting.com!newshosting.com!38.119.100.149.MISMATCH!out.nntp.be!sp12lax.superfeed.net!not-for-mail
Lines: 61
Organization: Newsgroups.com
Newsgroups: news.software.readers
X-Proxy-User: $$s_iz$n-74p
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-Report: Please report illegal or inappropriate use to
 <abuse@newsgroups.com>. Forward a copy of ALL headers INCLUDING the body. (DO
 NOT SEND ATTACHMENTS)
X-Comments2: IMPORTANT: Newsgroups.com does not condone, support,
 nor tolerate spam or any illegal or copyrighted postings.
X-Comments: This message was posted through Newsgroups.com
X-Original-Bytes: 3325
X-Original-Lines: 80