I've never used XML::RSS but it's possible that it could die if you try to parse bad XML. If it does, you may want to also do:<br><br>eval {<br> $rss->parse($data);<br>};<br>if ( $@ ) {<br> warn "Could not parse data\n";
<br>}<br><br>-Steve<br><br><div><span class="gmail_quote">On 9/26/06, <b class="gmail_sendername">jerry gay</b> <<a href="mailto:jerry.gay@gmail.com">jerry.gay@gmail.com</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;">
On 9/26/06, luis medrano <<a href="mailto:lmzaldivar@gmail.com">lmzaldivar@gmail.com</a>> wrote:<br>> I have this script:<br>><br>> foreach my $url (@list_of_rss_url){<br>><br>> my $rss=XML::RSS->new();
<br>> my $data=get($url)or die "Couldn't get it!";# unless defined $data;<br>> $rss->parse($data);<br>> foreach my $item (@{$rss->{items}}){<br>> my $link=$$item{link};
<br>> my $title=$$item{title};<br>> print "$link, $title \n";<br>> }<br>> }<br>><br>> but my problem is I don't want the script to die if the rss is not valid or<br>> not available when I call it.
<br>><br>so, don't C<die>!<br><br> ...<br> my $data= get($url);<br> unless($data) {<br> warn qq{warning: couldn't get "$url"};<br> next;<br> }<br> ...<br><br>~jerry<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></blockquote></div><br>