Demonstrate how to write out JSON or XML to a file using handlers. XML is the default if no argument is specified.
The file name will be catalog.xml, catalog.json or catalog.html depending the value of $ARGV[0] (<null>, json or html).
Please keep in mind this example only generates a partial list of titles from Lovefilm. If you want a full list you will have to extend it by paging.
You will get a warning from this script that mentions "__EMPY_CONTENT__" which you can ignore.
To install WWW::Lovefilm::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Lovefilm::API
CPAN shell
perl -MCPAN -e shell install WWW::Lovefilm::API
For more information on module installation, please visit the detailed CPAN module installation guide.