# let's create a writer.
my $writer = XML::FeedWriter->new(
# specify type/version; RSS 2.0 by default
version => '2.0',
# and channel info
title => 'feed title',
link => 'http://example.com',
description => 'blah blah blah',
# add as many items as you wish (and spec permits).
# each item should be a hash reference
title => 'first post',
description => 'plain text of the first post',
link => 'http://example.com/first_post',
updated => time(), # will be converted to a pubDate
creator => 'me', # alias for "dc:creator"
title => 'second post',
description => '<p>html of the second post</p>',
link => 'http://example.com/second_post',
pubdate => DateTime->now, # will be formatted properly
creator => 'someone',
# this will close several tags such as root 'rss'.
# then, if you want to save the feed to a file
# or just use it as an xml string.
my $string = $writer->as_string;
This is an RSS 2.0 feed writer. You usually don't need to use this directly, but if you insist, replace XML::FeedWriter with XML::FeedWriter::RSS20 and it works fine.
See XML::FeedWriter for usage.
Kenichi Ishigaki, <firstname.lastname@example.org>
Copyright (C) 2008 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install XML::FeedWriter, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.