Re: Net::NNTP
[email protected] (Jan Pieter Cornet) Tue, 8 Jul 2003 08:43:12 +0200
| Newsgroups | perl.libnet |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Jul 07, 2003 at 08:48:19PM -0000, Gene Mat wrote:
> I am trying to get a list of News Groups using Perl, however I get the
> following error, when I try either list(), newsgroups(), or the active ()
> functions.
>
> Can't call method "active" on an undefined value at ./getnntp.pl line 11.
>
> #!/opt/local/bin/perl
> use Net::NNTP;
Bzzt. Two errors already: You forgot the "-w" switch to perl,
and you probably forgot to "use strict".
Try the -w switch first, and the real error will be very obvious.
Then try "use strict" and you'll need to sprinkle a lot of "my"s
around.
> $nntp = Net::NNTP->new("news.microsoft.com",Debug,1);
> $DATE=$nntp->date;
> $GROUP=$nntp->group;
> ($narticles,$first,$last,$GROUP)=$nntp->group("microsoft.public.access");
> $XOVER=$nntp->xover(19303);
> $LIST=$nnpt->list;
> $nntp->quit;
>
> The other functions group,date and xover work fine.
Sure, because they're not called on an undefined value.
HTH,
--
#!perl -pl # This kenny-filter is virus-free as long as you don't copy it
$p=3-2*/[^\W\dmpf_]/i;s.[a-z]{$p}.vec($f=join('',$p-1?chr(sub{$_[0]*9+$_[1]*3+
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):('m',p,f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig; # Jan-Pieter Cornet