...(snip) $rss_out_file = "/home/foo/bar/public_html/RSS_feed.xml"; (A load of stuff to query our database and write the rows to an array of arrays) open RSSFILE, ">$rss_out_file" or die "Couldn't open RSS feed file: $!"; print RSSFILE ' RSS feed http://(server IP address)/ blah blah blah'; foreach $n(@RSStable) { print RSSFILE ''.$$n[0].''.$$n[1].''.$$n[2].''; } print RSSFILE ''; close RSSFILE;