# Find all articles in 'comp.lang.perl.misc' # that were posted in the last hour $news = $nntp->newnews( time - 3600, 'comp.lang.perl.misc') or die "Cannot get newnews: $!"; foreach $msgid (@$news) { # Get the subject line from the message $subj = $nntp->xhdr( 'Subject', $msgid ) or die "Cannot get subject: $!"; next unless $subj =~ /CPAN/ios; # Get the text of the article $article = $nntp->article($msgid) or die "Cannot get '$msgid': $!"; # Save the text in a file ($file = $msgid) =~ s/[<>\/\$]/_/g; open(ARTICLE, ">$file") or die "Cannot open $file: $!"; print ARTICLE @$article; close(ARTICLE); }