eval {
$feed = XML::Feed->parse($uri);
};
if($@){
...
Unfortunately, XML::Feed doesn't throw an error. It simply returns undef.
From synopsis:
use XML::Feed;
my $feed = XML::Feed->parse(URI->new('http://example.com/atom.xml'))
or die XML::Feed->errstr;