######################################################################
# Newsrc.pm
######################################################################
# Perl Power! - Michael Schilli 1998
######################################################################

use News::Newsrc;

$newsrc = News::Newsrc->new();    # create Newsrc object
    
$newsrc->load();                  # load ~/.newsrc
$newsrc->load($file);             # load $file as .newsrc
    
$newsrc->add_group($group);       # insert group
$newsrc->del_group($group);       # delete group
        
$newsrc->subscribe  ($group);     # activate group
$newsrc->unsubscribe($group);     # deactivate group

$newsrc->mark($group, $article);  # mark article in group

                                  # marl list of articles
$newsrc->mark_list($group, \@articles);

                                  # mark articles of a
                                  # number range
$newsrc->mark_range($group, $from, $to);  

                                  # unmark article
$newsrc->unmark($group, $article);

                                  # unmark article list
$newsrc->unmark_list($group, \@articles);

                                  # unmark number range
$newsrc->unmark_range($group, $from, $to);  
    
if($newsrc->exists($group)) {     # does group exist?
    print "$group exists!\n";
}

if($newsrc->subscribed($group)) { # group activated?
    print "$group active!\n";
}
                                  # article marked?
if($newsrc->marked($group, $article)) {
    print "Article $article in group $group marked!\n";
}

$newsrc->save();                  # store ~/.newsrc
$newsrc->save_as($file);          # store under different name
                                  # (both return 0!)

