For Programmers: Free Programming Magazines  


Home > Archive > PERL Programming > March 2004 > STILL OPEN! Is There Any GENIUS Out There (Excluding Matt, Gunnar, and a Couple of Ot









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author STILL OPEN! Is There Any GENIUS Out There (Excluding Matt, Gunnar, and a Couple of Ot
thesalia

2004-03-30, 12:31 am

I am trying to make an HTML file out of
an RSS file. The RSS file contains itmes of the type:

<item>
<title>Davies promises 2004 best year</title>
<link>http://www.worldpress.org/feed.cfm?...lead/lead1.html</link>
<description>Jamaica Gleaner, Centrist daily of Kingston,
Jamaica</description>
</item>

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.

@@@@@@@@@
while($helen=~
/<title>(.*?)<\/title><link>(.*?)<\/link><description>(.*?)<\/description>/)
{
$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
}
@@@@@@@@@
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com