#!/usr/bin/perl use strict; use warnings; use Test::More tests => 4; use XML::RSS; my $text = <<"EOF"; Journalism - Topix.net http://www.topix.net/news/journalism News on Journalism from Topix.net en-us Copyright 2006, Topix.net Topix.net http://www.topix.net/ http://www.topix.net/pics/logo4.gif Gannett Reportedly Mulling Tribune Bid http://topix.net/r/0l1Qq8DEtErajq5wDAIHZ0RavmEQ=2BIyZGBfGjcVwyQpW0DFdgUcy=2FtbxGNgMtYEdbU7ucVOR=2Bw2Bu6K4EDvt9=2B7ILEWB6Q5Zxy64f9JxkGU92am=2FLdMjb=2FCxbmfNuBQX6 Comment]]> The Associated Press on Topix.net Mon, 13 Nov 2006 15:50:44 GMT eQE3vmbXGCzvaHn0deSSyA Journalism - Topix.net Use the text input below to search Topix.net q http://www.topix.net/search/ EOF { my $rss = XML::RSS->new(); # TEST is ($rss->parse($text)->{textinput}->{link}, "http://www.topix.net/search/", "->parse() returns the object again" ); # TEST is ($rss->{textinput}->{link}, "http://www.topix.net/search/", "Testing for textinput link" ); # TEST is ($rss->{channel}->{link}, "http://www.topix.net/news/journalism", "Testing for channel link" ); } { my $rss = XML::RSS->new(); # TEST is ($rss->parsefile( File::Spec->catfile("t", "data", "2.0", "sf-hs-with-pubDate.rss") )->{channel}->{link}, "http://community.livejournal.com/shlomif_hsite/", "->parsefile() returns the object", ); }