ねもぷらす

ふぁいんでぃんぐねもの日記。プログラミングとか育児とか

備忘録

use strict;
use XML::RSS;
use Encode;
use utf8;

eval {
    my $rss_file = './sample.rdf' || shift;

    my $rss = new XML::RSS;
    $rss->parsefile("$rss_file") or die $!;

    foreach my $item (@{$rss->{'items'}}) {
        print "title: ". encode('utf-8', $item->{'title'} ) ."\n";
        print " link: ". $item->{'link'}  ."\n";
        print "\n";
    }

};if($@){
    print "error : $@\n";
}