Thread View: news.software.readers
21 messages
21 total messages
Started by Mats Peterson
Sun, 13 Apr 2008 08:51
PNews update
Author: Mats Peterson
Date: Sun, 13 Apr 2008 08:51
Date: Sun, 13 Apr 2008 08:51
6 lines
1189 bytes
1189 bytes
If anyone happened to get pnews-20080413.zip, please get it once again. I have made a small update to it. -- Mats Peterson http://www.geocities.com/matsp888/
Re: PNews update
Author: Gerry Ford
Date: Mon, 14 Apr 2008 05:11
Date: Mon, 14 Apr 2008 05:11
107 lines
4680 bytes
4680 bytes
"Mats Peterson" <matsp555@yahoo.com> wrote in message
news:FQjMj.5999$R_4.4766@newsb.telia.net...
> If anyone happened to get pnews-20080413.zip, please get it once again.
> I have made a small update to it.
Mats,
I made the download and am interested in writing news clients in perl. I've
written this one, (among many others of similar difficulty):
#!/usr/bin/perl -w
use strict;
use Net::NNTP ();
use constant NUMBER_OF_ARTICLES => 10;
use constant GROUP_NAME => 'comp.lang.c';
use constant SERVER_NAME => 'newsgroups.comcast.net';
use constant NNTP_DEBUG => 0;
my $nntp = Net::NNTP->new(SERVER_NAME, 'Debug' => NNTP_DEBUG) or die;
my $USER = 'mpjensen77@comcast.net';
my $PASS = '';
$nntp->authinfo($USER,$PASS) or die $!;
my($article_count, $first_article, $last_article) = $nntp->group(GROUP_NAME)
or die;
# Which XOVER fields contain Subject: and From:?
my $count = 0;
my %xover_fmt = map( ($_, $count++), @{ $nntp->overview_fmt or die} );
die unless exists $xover_fmt{'Subject:'};
my $subject_offset = $xover_fmt{'Subject:'};
my $from_offset = $xover_fmt{'From:'};
my(@xover, $start_article);
RETRIEVE: while ($#xover+1 < NUMBER_OF_ARTICLES and $last_article >=
$first_article) {
# How many articles do we need? Stop retrieving if we have enough
my $articles_required = NUMBER_OF_ARTICLES - ($#xover+1) or last
RETRIEVE;
# Fetch overview information for the articles
$start_article = $last_article - ($articles_required-1);
$start_article = $start_article > $first_article ? $start_article :
$first_article;
my $xover_query = $start_article == $last_article ?
$start_article :
[$start_article, $last_article];
my $xover_ref = $nntp->xover($xover_query) or die;
# Store headers for the articles we've retrieved
foreach (sort {$b <=> $a} keys %$xover_ref) {
push @xover, $xover_ref->{$_};
}
} continue {
# Move the pointer forward to fetch previous articles
$last_article = $start_article - 1;
}
# Disconnect from the NNTP server
$nntp->quit;
print join("\n", map ($_->[$subject_offset].' from '.$_->[$from_offset],
@xover)),"\n";
# perl perl23.pl 2>text50.txt >text51.txt
# end script, resume comment
Since we have the subject line here at the bottom, instead of printing it,
we could put it through regex, and if regex likes the string, it gets
printed else next message.
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?
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."
~~ Booman
Re: PNews update
Author: Mats Peterson
Date: Mon, 14 Apr 2008 08:31
Date: Mon, 14 Apr 2008 08:31
107 lines
4781 bytes
4781 bytes
"Gerry Ford" <gerry@nowhere.ford> wrote:
>
> "Mats Peterson" <matsp555@yahoo.com> wrote in message
> news:FQjMj.5999$R_4.4766@newsb.telia.net...
>> If anyone happened to get pnews-20080413.zip, please get it once again.
>> I have made a small update to it.
> Mats,
>
> I made the download and am interested in writing news clients in perl. I've
> written this one, (among many others of similar difficulty):
> #!/usr/bin/perl -w
>
> use strict;
> use Net::NNTP ();
>
> use constant NUMBER_OF_ARTICLES => 10;
> use constant GROUP_NAME => 'comp.lang.c';
> use constant SERVER_NAME => 'newsgroups.comcast.net';
> use constant NNTP_DEBUG => 0;
>
> my $nntp = Net::NNTP->new(SERVER_NAME, 'Debug' => NNTP_DEBUG) or die;
> my $USER = 'mpjensen77@comcast.net';
> my $PASS = '';
>
> $nntp->authinfo($USER,$PASS) or die $!;
>
>
> my($article_count, $first_article, $last_article) = $nntp->group(GROUP_NAME)
> or die;
>
>
> # Which XOVER fields contain Subject: and From:?
> my $count = 0;
> my %xover_fmt = map( ($_, $count++), @{ $nntp->overview_fmt or die} );
> die unless exists $xover_fmt{'Subject:'};
> my $subject_offset = $xover_fmt{'Subject:'};
> my $from_offset = $xover_fmt{'From:'};
>
> my(@xover, $start_article);
> RETRIEVE: while ($#xover+1 < NUMBER_OF_ARTICLES and $last_article >=
> $first_article) {
>
> # How many articles do we need? Stop retrieving if we have enough
> my $articles_required = NUMBER_OF_ARTICLES - ($#xover+1) or last
> RETRIEVE;
>
>
> # Fetch overview information for the articles
> $start_article = $last_article - ($articles_required-1);
> $start_article = $start_article > $first_article ? $start_article :
> $first_article;
>
> my $xover_query = $start_article == $last_article ?
> $start_article :
> [$start_article, $last_article];
> my $xover_ref = $nntp->xover($xover_query) or die;
>
> # Store headers for the articles we've retrieved
> foreach (sort {$b <=> $a} keys %$xover_ref) {
> push @xover, $xover_ref->{$_};
> }
> } continue {
> # Move the pointer forward to fetch previous articles
> $last_article = $start_article - 1;
> }
>
> # Disconnect from the NNTP server
> $nntp->quit;
>
> print join("\n", map ($_->[$subject_offset].' from '.$_->[$from_offset],
> @xover)),"\n";
>
> # perl perl23.pl 2>text50.txt >text51.txt
> # end script, resume comment
> Since we have the subject line here at the bottom, instead of printing it,
> we could put it through regex, and if regex likes the string, it gets
> printed else next message.
>
> 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.
--
Mats Peterson
http://www.geocities.com/matsp888/
Re: PNews update
Author: Gerry Ford
Date: Tue, 15 Apr 2008 05:41
Date: Tue, 15 Apr 2008 05:41
87 lines
3804 bytes
3804 bytes
"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. In c.l.p.misc, someone posted a link to this:
package Win32::Console::ANSI;
#
# Copyright (c) 2004 Jean-Louis Morel <jl_morel@bribes.org>
#
# Version 1.01 (08/06/2005)
#
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
# GNU General Public License or the Artistic License for more details.
#
use 5.006;
use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
our $VERSION = '1.00';
our %EXPORT_TAGS = (
'all' => [ qw( Title Cursor XYMax SetConsoleSize Cls ScriptCP )],
);
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} },
);
our @EXPORT = qw(
);
package Win32::Console::ANSI;
require XSLoader;
XSLoader::load('Win32::Console::ANSI', $VERSION);
1;
__END__
# pod data snipped; it was long.
This has a cls but not a coninit. What module do you mean by this and how
do I acquire it?
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."
~~ Booman
Re: PNews update
Author: Mats Peterson
Date: Tue, 15 Apr 2008 06:53
Date: Tue, 15 Apr 2008 06:53
45 lines
2840 bytes
2840 bytes
"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. -- Mats Peterson http://www.geocities.com/matsp888/
Re: PNews update
Author: Mats Peterson
Date: Tue, 15 Apr 2008 06:56
Date: Tue, 15 Apr 2008 06:56
49 lines
2956 bytes
2956 bytes
Mats Peterson <matsp555@yahoo.com> wrote: > "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. > And it requires Win32::ANSI::Console to be installed. -- Mats Peterson http://www.geocities.com/matsp888/
Re: PNews update
Author: Mats Peterson
Date: Tue, 15 Apr 2008 06:57
Date: Tue, 15 Apr 2008 06:57
53 lines
3128 bytes
3128 bytes
Mats Peterson <matsp555@yahoo.com> wrote: > Mats Peterson <matsp555@yahoo.com> wrote: >> "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. >> > > And it requires Win32::ANSI::Console to be installed. > I'm sorry, it should be Win32::Console::ANSI. -- Mats Peterson http://www.geocities.com/matsp888/
Re: PNews update
Author: frydd
Date: Tue, 15 Apr 2008 08:40
Date: Tue, 15 Apr 2008 08:40
18 lines
2052 bytes
2052 bytes
On 15 Apr., 08:57, Mats Peterson <matsp...@yahoo.com> wrote:
{...]
>>>>>> perl.exe
[...]
>>> Unzip it and place the contents somewhere where Perl looks for modules,
>>> \Perl\site\lib etc.
>
>> And it requires Win32::ANSI::Console to be installed.
>
> I'm sorry, it should be Win32::Console::ANSI.
>
requires, requires........I think it would be useful to create a
complete packet with all requirements and set it 4 download.
--
frydd(s).....the GOOGLEcat
Re: PNews update
Author: Gerry Ford
Date: Tue, 15 Apr 2008 09:01
Date: Tue, 15 Apr 2008 09:01
33 lines
2628 bytes
2628 bytes
"frydd" <frydd@spamfence.net> wrote in message
news:7e387030-6704-48fe-b1cf-444d0975ec75@c65g2000hsa.googlegroups.com...
> On 15 Apr., 08:57, Mats Peterson <matsp...@yahoo.com> wrote:
>
> {...]
>>>>>>> perl.exe
> [...]
>>>> Unzip it and place the contents somewhere where Perl looks for modules,
>>>> \Perl\site\lib etc.
>>
>>> And it requires Win32::ANSI::Console to be installed.
>>
>> I'm sorry, it should be Win32::Console::ANSI.
>>
>
> requires, requires........I think it would be useful to create a
> complete packet with all requirements and set it 4 download.
Having to rummage around on the net to find modules is the downside to
getting the functionality of perl.
That it doesn't have one-click functionality is endemic to the beast, but
your point is well-taken. If Mats wants ordinary mortals to use his
software, I would advise him to bundle non-core modules with the original
product.
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."
~~ Booman
Re: PNews update
Author: Gerry Ford
Date: Tue, 15 Apr 2008 09:06
Date: Tue, 15 Apr 2008 09:06
73 lines
3950 bytes
3950 bytes
"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?
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."
~~ Booman
Re: PNews update
Author: truman burbank
Date: Tue, 15 Apr 2008 09:53
Date: Tue, 15 Apr 2008 09:53
8 lines
1565 bytes
1565 bytes
On 13 Apr, 10:51, Mats Peterson <matsp...@yahoo.com> wrote: > If anyone happened to get pnews-20080413.zip, please get it once again. > I have made a small update to it. > > -- > Mats Petersonhttp://www.geocities.com/matsp888/ ?
Re: PNews update
Author: catapuna
Date: Tue, 15 Apr 2008 10:12
Date: Tue, 15 Apr 2008 10:12
8 lines
1548 bytes
1548 bytes
On 13 Apr, 10:51, Mats Peterson <matsp...@yahoo.com> wrote: > If anyone happened to get pnews-20080413.zip, please get it once again. > I have made a small update to it. > > -- > Mats Petersonhttp://www.geocities.com/matsp888/ what?
Re: PNews update
Author: Mats Peterson
Date: Tue, 15 Apr 2008 12:48
Date: Tue, 15 Apr 2008 12:48
84 lines
4477 bytes
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/
Re: PNews update
Author: Mats Peterson
Date: Tue, 15 Apr 2008 12:49
Date: Tue, 15 Apr 2008 12:49
20 lines
2166 bytes
2166 bytes
Mats Peterson <matsp555@yahoo.com> wrote: > 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. > Win32::ANSI::Consol should be Win32::Console::ANSI, for the record. -- Mats Peterson http://www.geocities.com/matsp888/
Re: PNews update
Author: I R A Darth Aggie
Date: Tue, 15 Apr 2008 16:39
Date: Tue, 15 Apr 2008 16:39
38 lines
3110 bytes
3110 bytes
On Tue, 15 Apr 2008 04:01:42 -0500,
Gerry Ford <gerry@nowhere.ford>, in
<1208249669_12@news.newsgroups.com> wrote:
>+
>+ "frydd" <frydd@spamfence.net> wrote in message
>+ news:7e387030-6704-48fe-b1cf-444d0975ec75@c65g2000hsa.googlegroups.com...
>+ > On 15 Apr., 08:57, Mats Peterson <matsp...@yahoo.com> wrote:
>+ >
>+ > {...]
>+ >>>>>>> perl.exe
>+ > [...]
>+ >>>> Unzip it and place the contents somewhere where Perl looks for modules,
>+ >>>> \Perl\site\lib etc.
>+ >>
>+ >>> And it requires Win32::ANSI::Console to be installed.
>+ >>
>+ >> I'm sorry, it should be Win32::Console::ANSI.
>+ >>
>+ >
>+ > requires, requires........I think it would be useful to create a
>+ > complete packet with all requirements and set it 4 download.
>+ Having to rummage around on the net to find modules is the downside to
>+ getting the functionality of perl.
That "downside" is at least partially addressed:
perl -MCPAN -e shell;
It will walk you thru the configuration. It probably will work better
under a *ix platform, or faux-platform like Cygwin.
http://www.perl.com/doc/manual/html/lib/CPAN.html
--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.
Re: PNews update
Author: I R A Darth Aggie
Date: Tue, 15 Apr 2008 16:45
Date: Tue, 15 Apr 2008 16:45
23 lines
2687 bytes
2687 bytes
On Tue, 15 Apr 2008 16:39:18 +0000 (UTC), I R A Darth Aggie <n0b0dy@invalid.invalid>, in <slrng09mhm.sg.n0b0dy@invalid.invalid> wrote: >+ That "downside" is at least partially addressed: >+ >+ perl -MCPAN -e shell; >+ >+ It will walk you thru the configuration. It probably will work better >+ under a *ix platform, or faux-platform like Cygwin. >+ >+ http://www.perl.com/doc/manual/html/lib/CPAN.html Addendum: assuming, of course, what you need/want is in a CPAN archive. The Win32::Console::ANSI would be an example of an add-on that exists in the CPAN archive and can be installed via the CPAN perl shell. -- Consulting Minister for Consultants, DNRC I can please only one person per day. Today is not your day. Tomorrow isn't looking good, either. I am BOFH. Resistance is futile. Your network will be assimilated.
Re: PNews update
Author: Gerry Ford
Date: Tue, 15 Apr 2008 22:58
Date: Tue, 15 Apr 2008 22:58
46 lines
3137 bytes
3137 bytes
"I R A Darth Aggie" <n0b0dy@invalid.invalid> wrote in message
news:slrng09mhm.sg.n0b0dy@invalid.invalid...
> On Tue, 15 Apr 2008 04:01:42 -0500,
> Gerry Ford <gerry@nowhere.ford>, in
> <1208249669_12@news.newsgroups.com> wrote:
>>+
>>+ "frydd" <frydd@spamfence.net> wrote in message
>>+
>>news:7e387030-6704-48fe-b1cf-444d0975ec75@c65g2000hsa.googlegroups.com...
>>+ > On 15 Apr., 08:57, Mats Peterson <matsp...@yahoo.com> wrote:
>>+ >
>>+ > {...]
>>+ >>>>>>> perl.exe
>>+ > [...]
>>+ >>>> Unzip it and place the contents somewhere where Perl looks for
>>modules,
>>+ >>>> \Perl\site\lib etc.
>>+ >>
>>+ >>> And it requires Win32::ANSI::Console to be installed.
>>+ >>
>>+ >> I'm sorry, it should be Win32::Console::ANSI.
>>+ >>
>>+ >
>>+ > requires, requires........I think it would be useful to create a
>>+ > complete packet with all requirements and set it 4 download.
>>+ Having to rummage around on the net to find modules is the downside to
>>+ getting the functionality of perl.
>
> That "downside" is at least partially addressed:
>
> perl -MCPAN -e shell;
Interesting information here. I was unable to redirect into a file, but
here's a screenshot:
http://zaxfuuq.net/perl152.jpg
It didn't look like much succeeded with the test calls for win32 console
stuff.
--
"Shopping for toilets isn't the most fascinating way to spend a Saturday
afternoon. But it beats watching cable news."
~~ Booman
Re: PNews update
Author: Gerry Ford
Date: Tue, 15 Apr 2008 23:18
Date: Tue, 15 Apr 2008 23:18
49 lines
3760 bytes
3760 bytes
"Mats Peterson" <matsp555@yahoo.com> wrote in message news:Sv1Nj.6100$R_4.4848@newsb.telia.net... > Mats Peterson <matsp555@yahoo.com> wrote: >> 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. >> > > Win32::ANSI::Consol should be Win32::Console::ANSI, for the record. I got a handle on that now. Your ANSIConsole.pm wraps Win32::Console::ANSI.pm and adds bells and whistles with the coninit. It turns out that this is the only module outside of the core for AS 5.10 One problem we have is that there's no authentication with the server. These data would have to be specified in pnews.rc along with everything else. As it is, your script hangs with new.newsgroups.com> in a dos window. I'm getting the feeling that this is very much a piece of art still in the making. That's fine, my scripts are the same way. What I propose is that we write a version from scratch that is much simplified. To this end, we would exchange e-mail and post in relevant fora as well. My knowledge of perl isn't much more than the minimal clients I have written. I also wrote one numerical program in perl that took 80 versions to get right. The first 79 were ugly, but I think the 80th is the only one of its kind. Numerical routines are usually the purview of compiled languages. You can indicate your willingness directly: wade196884@netzero.net . My name is Merrill. -- "Shopping for toilets isn't the most fascinating way to spend a Saturday afternoon. But it beats watching cable news." ~~ Booman
Re: PNews update
Author: I R A Darth Aggie
Date: Wed, 16 Apr 2008 13:32
Date: Wed, 16 Apr 2008 13:32
50 lines
3723 bytes
3723 bytes
On Tue, 15 Apr 2008 17:58:39 -0500,
Gerry Ford <gerry@nowhere.ford>, in
<1208299882_18@news.newsgroups.com> wrote:
>+
>+ "I R A Darth Aggie" <n0b0dy@invalid.invalid> wrote in message
>+ news:slrng09mhm.sg.n0b0dy@invalid.invalid...
>+ > On Tue, 15 Apr 2008 04:01:42 -0500,
>+ > Gerry Ford <gerry@nowhere.ford>, in
>+ > <1208249669_12@news.newsgroups.com> wrote:
>+ >>+
>+ >>+ "frydd" <frydd@spamfence.net> wrote in message
>+ >>+
>+ >>news:7e387030-6704-48fe-b1cf-444d0975ec75@c65g2000hsa.googlegroups.com...
>+ >>+ > On 15 Apr., 08:57, Mats Peterson <matsp...@yahoo.com> wrote:
>+ >>+ >
>+ >>+ > {...]
>+ >>+ >>>>>>> perl.exe
>+ >>+ > [...]
>+ >>+ >>>> Unzip it and place the contents somewhere where Perl looks for
>+ >>modules,
>+ >>+ >>>> \Perl\site\lib etc.
>+ >>+ >>
>+ >>+ >>> And it requires Win32::ANSI::Console to be installed.
>+ >>+ >>
>+ >>+ >> I'm sorry, it should be Win32::Console::ANSI.
>+ >>+ >>
>+ >>+ >
>+ >>+ > requires, requires........I think it would be useful to create a
>+ >>+ > complete packet with all requirements and set it 4 download.
>+ >>+ Having to rummage around on the net to find modules is the downside to
>+ >>+ getting the functionality of perl.
>+ >
>+ > That "downside" is at least partially addressed:
>+ >
>+ > perl -MCPAN -e shell;
>+ Interesting information here. I was unable to redirect into a file, but
>+ here's a screenshot:
>+ http://zaxfuuq.net/perl152.jpg
>+
>+ It didn't look like much succeeded with the test calls for win32 console
>+ stuff.
Yeah, you need a C compiler, in your example, it was looking for gcc-4.3.
Not everything in CPAN is pure perl.
--
Consulting Minister for Consultants, DNRC
I can please only one person per day. Today is not your day. Tomorrow
isn't looking good, either.
I am BOFH. Resistance is futile. Your network will be assimilated.
Re: PNews update
Author: Mats Peterson
Date: Wed, 16 Apr 2008 13:44
Date: Wed, 16 Apr 2008 13:44
55 lines
3781 bytes
3781 bytes
I R A Darth Aggie <n0b0dy@invalid.invalid> wrote:
> On Tue, 15 Apr 2008 17:58:39 -0500,
> Gerry Ford <gerry@nowhere.ford>, in
> <1208299882_18@news.newsgroups.com> wrote:
>> +
>> + "I R A Darth Aggie" <n0b0dy@invalid.invalid> wrote in message
>> + news:slrng09mhm.sg.n0b0dy@invalid.invalid...
>> + > On Tue, 15 Apr 2008 04:01:42 -0500,
>> + > Gerry Ford <gerry@nowhere.ford>, in
>> + > <1208249669_12@news.newsgroups.com> wrote:
>> + >>+
>> + >>+ "frydd" <frydd@spamfence.net> wrote in message
>> + >>+
>> + >>news:7e387030-6704-48fe-b1cf-444d0975ec75@c65g2000hsa.googlegroups.com...
>> + >>+ > On 15 Apr., 08:57, Mats Peterson <matsp...@yahoo.com> wrote:
>> + >>+ >
>> + >>+ > {...]
>> + >>+ >>>>>>> perl.exe
>> + >>+ > [...]
>> + >>+ >>>> Unzip it and place the contents somewhere where Perl looks for
>> + >>modules,
>> + >>+ >>>> \Perl\site\lib etc.
>> + >>+ >>
>> + >>+ >>> And it requires Win32::ANSI::Console to be installed.
>> + >>+ >>
>> + >>+ >> I'm sorry, it should be Win32::Console::ANSI.
>> + >>+ >>
>> + >>+ >
>> + >>+ > requires, requires........I think it would be useful to create a
>> + >>+ > complete packet with all requirements and set it 4 download.
>> + >>+ Having to rummage around on the net to find modules is the downside to
>> + >>+ getting the functionality of perl.
>> + >
>> + > That "downside" is at least partially addressed:
>> + >
>> + > perl -MCPAN -e shell;
>> + Interesting information here. I was unable to redirect into a file, but
>> + here's a screenshot:
>> + http://zaxfuuq.net/perl152.jpg
>> +
>> + It didn't look like much succeeded with the test calls for win32 console
>> + stuff.
>
> Yeah, you need a C compiler, in your example, it was looking for gcc-4.3.
> Not everything in CPAN is pure perl.
>
The cleanest way to get a proper installation of Win32::Console::ANSI
in ActivePerl, without having to compile anything yourself, is to use
PPM, the Perl Package Manager. There should be a shortcut to it
in the start menu after installing ActivePerl.
--
Mats Peterson
http://www.geocities.com/matsp888/
Re: PNews update
Author: Gerry Ford
Date: Thu, 17 Apr 2008 23:24
Date: Thu, 17 Apr 2008 23:24
48 lines
3537 bytes
3537 bytes
"Mats Peterson" <matsp555@yahoo.com> wrote in message news:VonNj.6148$R_4.4869@newsb.telia.net... >I R A Darth Aggie <n0b0dy@invalid.invalid> wrote: >> On Tue, 15 Apr 2008 17:58:39 -0500, >> Gerry Ford <gerry@nowhere.ford>, in >> <1208299882_18@news.newsgroups.com> wrote: >>> + >>> + "I R A Darth Aggie" <n0b0dy@invalid.invalid> wrote in message >>> + > That "downside" is at least partially addressed: >>> + > >>> + > perl -MCPAN -e shell; >>> + Interesting information here. I was unable to redirect into a file, >>> but >>> + here's a screenshot: >>> + http://zaxfuuq.net/perl152.jpg >>> + >>> + It didn't look like much succeeded with the test calls for win32 >>> console >>> + stuff. >> >> Yeah, you need a C compiler, in your example, it was looking for gcc-4.3. >> Not everything in CPAN is pure perl. >> > > The cleanest way to get a proper installation of Win32::Console::ANSI > in ActivePerl, without having to compile anything yourself, is to use > PPM, the Perl Package Manager. There should be a shortcut to it > in the start menu after installing ActivePerl. It is. Once a person realizes that this is what he needs to find with ppm. Ppm will then make a Win32 folder, that has a Console subfolder, and finally puts ANSI.pm in this. Thereafter, you need to copy Mats' home-grown ANSIConsole.pm into the Win32 folder. That files need to go in certain folders is the way unix works, even when it's windows imitating. Is Darth telling me that my life would go better if I placed gcc.exe (4.3.0) in my perl bin? -- "A belief in a supernatural source of evil is not necessary; men alone are quite capable of every wickedness." ~~ Joseph Conrad (1857-1924), novelist
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