Here is the funny thing. I ran the script this morning and I didn't have any errors of any kind. My question is why this error is showing yesterday and not today.<br><br>Here is the script:<br><br>#!/usr/bin/perl<br>use strict;
<br>use LWP::Simple;<br>use XML::RSS;<br>my @feeds;<br>#yahoo_rss is a file with rss url such as this:<br>#http://news.search.yahoo.com/news/rss?p=mac&ei=UTF-8&fl=0&x=wrt<br>my $file_list="yahoo_rss.txt";
<br>open (FILE,$file_list) or die;<br>my @list=<FILE>;<br>close(FILE);<br>foreach my $line (@list){<br> chomp($line);<br> my ($tmp,$yahoo)=split(/\t/,$line);<br> push @feeds, $yahoo;<br>}<br><br>
<br><br><br>foreach my $url (@feeds){<br> my $rss=XML::RSS->new();<br> my $data=get($url);<br> $rss->parse($data);<br> my $channel=$rss->{channel};<br> my $image=$rss->{image};
<br> foreach my $item(@{$rss->{items}}){<br> my ($tmp,$link)=split(/\*/,$$item{link});<br> $link=~s/\%3A/\:/g;<br> print qq| <center><h3><a href ="$link">$$item{title}</a></h3></center></br></br>$$item{description}</br></br>|;
<br> }<br><br>}<br><br><br><br><div><span class="gmail_quote">On 9/18/06, <b class="gmail_sendername">Jeremy G. Kahn</b> <<a href="mailto:kahn@cpan.org">kahn@cpan.org</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It appears that your $data is probably empty or not valid XML. put in<br>some warnings after line 2 of your exmaple?<br><br>or maybe post an entire test script?<br><br>-jeremy<br><br>luis medrano wrote:<br>> I trying to run this code:
<br>><br>> my $rss=XML::RSS->new();<br>> my $data=get($url);<br>> $rss->parse($data);<br>><br>> but at the moment when I run this code I have this error:<br>><br>> no element found at line 1, column 0, byte -1 at
<br>> /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi/XML/Parser.pm<br>> line 187<br>> $ vi<br>> /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi/XML/Parser.pm<br>> $ vi<br>> /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi/XML/Parser.pm
<br>> ------------------------------------------------------------------------<br>><br>> _____________________________________________________________<br>> Seattle Perl Users Group Mailing List<br>> POST TO:
<a href="mailto:spug-list@pm.org">spug-list@pm.org</a><br>> SUBSCRIPTION: <a href="http://mail.pm.org/mailman/listinfo/spug-list">http://mail.pm.org/mailman/listinfo/spug-list</a><br>> MEETINGS: 3rd Tuesdays<br>
> WEB PAGE: <a href="http://seattleperl.org/">http://seattleperl.org/</a><br><br></blockquote></div><br>