Example-1 Very simple example
This very simple example shows how to create a basic command line tool. The script would be called from the command line with a call with a URI to collect the RSS file from and the file to transform the XML with, and output going to STDOUT.
#!/usr/bin/perl use strict; use XML::RSS::Tools; my $rss = XML::RSS::Tools->new; if ($rss->rss_uri(shift) && $rss->xsl_file(shift) && $rss->transform) { print $rss->as_string } else { print $rss->as_string('error') };
To install XML::RSS::Tools, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::RSS::Tools
CPAN shell
perl -MCPAN -e shell install XML::RSS::Tools
For more information on module installation, please visit the detailed CPAN module installation guide.