Re: retrieving news messages




"David Harmon" <source@xxxxxxxxxx> wrote in message
news:13ksp20d0m9g2c5@xxxxxxxxxxxxxxxxxxxxx
On Thu, 05 Jul 2007 12:25:20 -0700 in comp.lang.perl.misc, Joe Smith
<joe@xxxxxxxxx> wrote,
my $nntp = Net::NNTP->new('newsgroups.comcast.net', { Debug => 1} );
die "Unable to create NNTP object" unless $nntp;

You have got to get those two statements working before proceeding
any further.

It appears to me, that style of passing arguments to Net::NNTP->new
cannot work. I see this code in Net/NNTP.pm:

sub new
{
my $self = shift;
my $type = ref($self) || $self;
my ($host,%arg);
if (@_ % 2) {
$host = shift ;
%arg = @_;
} else {
%arg = @_;
$host=delete $arg{Host};
}


The above looks wrong to me; I think it ought to be more like

if (not (@_ % 2)) {

However, I'm still something of a Perl newbie, and am not quite sure
of all that I am looking at here. It appears that the constructor
fails to pick up the Host argument, but then it goes on to look for
the NNTPSERVER environment variable and use that, as documented.
I guess that everyone who got it to work had some such luck.

What do you all think?
Dude, they're dissing you.

Your constructor fails. They know why, and apparently, you don't.
--
Gerry Ford




----== Posted via Newsgroups.com - Usenet Access to over 100,000 Newsgroups ==----
Get Anonymous, Uncensored, Access to West and East Coast Server Farms at!
----== Highest Retention and Completion Rates! HTTP://WWW.NEWSGROUPS.COM ==----
.