| Previous | Next
The News::Newsrc ModuleMost Unix-based newsreaders parse and extract your newsgroup information from a newsrc file. This file contains an entry for each newsgroup, with the name of the group and a comma-separated list of article numbers from 1 to the current article. The first entry in the list shows articles that have been read; the remaining entries list unread articles. Each entry also has a colon (:) following the name if you are subscribed to that newsgroup, or an exclamation point ( To read a newsgroup, your newsreader needs to be connected to an NNTP server. The newsreader then checks the newsrc entry for that newsgroup to determine which articles you haven't read, and displays the first unread article. You can then read the articles sequentially or select which articles you want to read. When you "catch-up" a newsgroup by marking all the articles as "read", or when you exit from the newsreader program, your newsrc file is updated to reflect your activity during that session. The News::Newsrc module provides methods for managing your newsrc file. Some of the functions it provides include letting you add, remove, or reorder newsgroups; subscribe to or unsubscribe from newsgroups; and mark articles as read or unmark them. Unless you tell it to rearrange the order of the newsgroups in newsrc, News::Newsrc leaves the order unchanged. News::Newsrc Reference
$newsrc = new News::Newsrc Constructor. Creates a new News::Newsrc object that contains no newsgroups.
$newsrc->add_group(groupname[, options]) Adds newsgroup to newsrc, as a subscribed group. Defaults to adding at the end. The arguments are:
$newsrc->del_group(groupname) Removes specified newsgroup
$newsrc->exists(groupname) Returns true if newsgroup
$newsrc->groups( ) Returns list of newsgroups in newsrc. In scalar context, returns an array reference.
$newsrc->load([filename]) Loads newsgroups in
$newsrc->mark(groupname, article_number[, options]) Adds an article to the list for a specified newsgroup. Arguments are:
$newsrc->marked(groupname, article_number) Returns true if the newsgroup exists and contains the specified article. Arguments are:
$newsrc->marked_articles(groupname) Returns the list of articles in group
$newsrc->mark_list(groupname, \@
Adds articles to the list for a specified group. Arguments are:
$newsrc->mark_range(groupname, n, m[, options]) Adds articles in the specified range to the list. Arguments are:
$newsrc->save( )
$newsrc->save_as(filename) Saves changes to specified file
$newsrc->sub_groups( ) Returns list of subscribed groups in newsrc.
$newsrc->subscribe(groupname) Subscribes to newsgroup
$newsrc->subscribed(groupname) Returns true if the group
$newsrc->unmark(groupname, article_number[, options]) Removes specified article from the group list. Arguments are:
$newsrc->unmarked_articles(groupname, n, m[, options]) Returns the list of articles from
$newsrc->unmark_list(groupname, \@article_list[, options) Removes specified list of articles from the group list. Arguments are:
$newsrc->unmark_range(groupname, n, m[, options]) Removes a range of articles from
$newsrc->unsub_groups( ) Returns list of unsubscribed groups in newsrc. In scalar context, returns an array reference.
$newsrc->unsubscribe(groupname[, options]) Unsubscribes from newsgroup in newsrc. If the group is not in newsrc, it is added. Arguments are: |