williams554 has asked for the wisdom of the Perl Monks concerning the following question:

I’m new to perl. I invented a project for myself. I wanted to download and process a show I’m watching off a news server but I’ve hit a snag I can’t seem to get past.
use News::NNTPClient; $c = new News::NNTPClient("news.easynews.com"); $c->authinfo("****","****"); ($first, $last) = ($c->group("alt.binaries.tv.big-brother")); @ARRAY = $c->xpat("", $first, $last, qw(*Big.Brother.UK.S08.D003d.*)); foreach (@ARRAY) { @FIELDS = split; foreach (@FIELDS) { $FIELDS[13] =~ s/\"//g; open OUTPUT, ">>bbuk/$FIELDS[13]"; print OUTPUT $c->body($FIELDS[0]); close OUTPUT; print "\n\n*********** $FIELDS[0]", $c->message, "\n"; } }
I'm getting error like this:
*********** 6536628 News::NNTPClient garbled response: =ybegin part=1 line=128 size=9752 name=Big.Br other.UK.S08.D003d.Big.Mouth.XviD.PDTV.MJL.par2 *********** 6536628 News::NNTPClient garbled response: =ypart begin=1 end=9752 *********** 6536628 News::NNTPClient garbled response: zk|\*zu~Γ*******╟εáN╕░X°╛u┌╦⌂wJ°.Æîóæ@█ì≡µE¶┬ Öz zk|J\XZ*pôûÅnÅ¥ì▒φp▬♫K♠~Wzéqü¿5╔6├↔ú8ε♦▀Dï▄=}♣⌐>├µ▌&╡HL╚┼╫ÿz┤ZæíñΩ♂♫**** *lôæXl£Ö
I’m using activestate perl version 5.6.1 on a windows box. Any advice?

Replies are listed 'Best First'.
Re: Downloading messages from news server
by Popcorn Dave (Abbot) on Jun 03, 2007 at 23:56 UTC
    It looks like you're running in to two different problems.

    First it appears that you're getting just a part of a multi-part file. Secondly you're going to need save the parts as binary files I believe.

    Something like:

    my $num = 0; binmode; ( Thanks to anonymonk for pointing out my mistake) open OUTPUT, ">filepart".$num # print your information here close OUTPUT;

    As far as putting together multi-part binaries that's beyond my scope, but you're going to need to assemble the parts in order then decode them. CPAN should have the module to do the decoding for you.

    Good luck!

    Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

    I would love to change the world, but they won't give me the source code

      You're full of beans popcorn :) binmode
        You're right. I'm fighting a headcold so I beg forgiveness on that. :) (Plus I'm updating the node)
        Revolution. Today, 3 O'Clock. Meet behind the monkey bars.

        I would love to change the world, but they won't give me the source code