#!/usr/bin/perl -w # Here, we're calling two modules or additions to Perl. The first one we # installed on the server specifically for this occasion, but 'use # strict' is a helpful little addition if you want to write good code. # It catches a lot of the human idiocy that plagues horrible programs. use XML::RSS; use strict; # create some variables near the top of the script so we don't # have to search through the script later to change them. my $headlines_file = "/path/to/headlines.html"; my $rss_output = "/path/to/headlines.rss"; # we create a new rss object. my $rss = new XML::RSS (version => '0.9'); # these are just little descriptive elements of the RSS channel we're # about to make. we add them to the $rss object we made above. $rss->channel(title => "Your Site Name", link => "http://www.yoursitename.com/", description => "Headlines from Your Site Name!", ); # we open the file with our headlines in it. open(FILE, "<$headlines_file") or die "Couldn't open $headlines_file: $!"; # a traditional while loop. for each line of our $headlines_file # we start looking for markers within the code that tell us a # headline is coming. in this example, we're assuming that headlines # follow html like