in reply to Re: how to use article() function in perl Net::NNTP module?
in thread how to use article() function in perl Net::NNTP module?

Thanks for the references.Those would definitely help at some point or other. Now, I am able to do the required task with the following code

open(ARTICLE,">>indexer.txt") or die "Cannot open indexer.txt"; my $data=$nntp->article(99); print ARTICLE @$data; #print ARTICLE "Completed Successfully"; close(ARTICLE);
However, I want to know if there is a better way to do it using the file handle that the article() function returns. As for data dumper, it does the task as well, but the output is in pretty untidy format. And the problem I am facing is that I do not know how to use tied filehandles. Any code snippet would be highly appreciated

Replies are listed 'Best First'.
Re^3: how to use article() function in perl Net::NNTP module?
by Corion (Patriarch) on Oct 21, 2013 at 10:59 UTC

    You can treat a (tied) filehandle just like any other filehandle. It acts like a filehandle, but maybe its data does reside in memory or somewhere else. As a consumer of data, you usually don't need to care about this.

    ... my $fh= $nntp->articlefh(...); while( <$fh>) { print "Article: $_\n"; }; ...

      That worked very well, thanks for your help!! It was just a matter of correct syntax, which turns out to be pretty simple