hermes has asked for the wisdom of the Perl Monks concerning the following question:
As you can see, I need to extract the Headline (<title></title>), the URL (<link></link>) and the description (<description></description>) from each such item group. The following piece of code does not work. Could you please direct me as to how to extract the above 3 items properly? The program dos not read any of the items in this fashion.<item> <title>Davies promises 2004 best year</title> <link>http://www.worldpress.org/feed.cfmhttp://www.jamaica-gleaner.com +:80/gleaner/20040326/lead/lead1.html</link> <description>Jamaica Gleaner, Centrist daily of Kingston, Jamaica</description> </item>
Thanks a million!@@@@@@@@@ while($maryb=~ /<title>(.*?)<\/title><link>(.*?)<\/link><description>(.*?)<\/descript +ion>/) { $headline=$1; $url=$2; $desc=$3; print FILE <<"UP_TO_HERE"; <title>$headline</title> <a href=\"$url\"> $headline</a><br> <font size=\"-1\"><b>$desc</b></font><br><br> UP_TO_HERE } @@@@@@@@@
maryb
Edit by tye, add CODE and P tags
Edit2 by Chady -- retitled from 'A Very Simple Question'
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Converting RSS file to HTML
by Hero Zzyzzx (Curate) on Mar 27, 2004 at 04:21 UTC | |
Re: Converting RSS file to HTML
by Vautrin (Hermit) on Mar 27, 2004 at 16:54 UTC | |
Re: Converting RSS file to HTML
by ajt (Prior) on Mar 27, 2004 at 16:53 UTC |