Subject: | XML::RSS::Private::Output::Base::_encode confesses too much |
Date: | Tue, 4 Sep 2007 13:32:45 -0400 |
To: | bug-XML-RSS [...] rt.cpan.org |
From: | "Dan Rinzel" <dan2bit [...] gmail.com> |
XML::RSS::Private::Output::Base::_encode's confess is being tripped by
the following script in 1.31, which worked fine under previous
versions of XML::RSS - it does not matter what value $spin gets. I
also tried patching my script by adding an empty
description => " "
for my item, and by using
$single->{output} = "0.9";
to no avail. I ended up patching _encode to just return; instead of
confessing, which restored the functionality to the script, but seems
like there should be a better way.
Thanks for the work on the module though, it is great!
-dan2bit
use XML::RSS;
while (<DATA>) {
next unless /^(\d+)\.\s+/;
$num = $1;
chomp;
s/^\d+\.\s+//;
$rules{$num} = $_;
}
print "Content-type:text/xml \n\n";
my @spin = (1..$num);
my $spin = $spin[rand $#spin];
my $rule = $rules{$spin};
my $single = new XML::RSS (version => '0.9');
$single->channel(
title => "Evil Overlord Rule $spin",
link => 'http://www.eviloverlord.com',
);
my %item = (
title => $rule,
);
$single->add_item(%item);
print $single->as_string;
__END__
1. My Legions of Terror will have helmets with clear plexiglass
visors, not face-concealing ones.
.... more data here ....