Re: retrieving news messages
- From: David Harmon <source@xxxxxxxxxx>
- Date: Wed, 28 Nov 2007 23:03:22 -0800
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?
.
- Follow-Ups:
- Re: retrieving news messages
- From: A. Sinan Unur
- Re: retrieving news messages
- From: Tad McClellan
- Re: retrieving news messages
- From: Gerry Ford
- Re: retrieving news messages
- Prev by Date: Re: Side effects of overloading quotes ""
- Next by Date: Re: SvUOK always fails on 64bit platform
- Previous by thread: writing to a notepad in perl
- Next by thread: Re: retrieving news messages
- Index(es):
Relevant Pages
|