in reply to Writing a simple RSS aggregator.
The xml in the feed is spread over several lines, but you're reading only one at a time. No one line matches all your regex.
Try setting local $/ = '</item>'; before reading. The alternative is to forget the intermediate file, rely on the linebreaks, and do global matching a la,
That is pretty fragile, however. I suspect you're doing this as a favor and it seems odd that you have to rewrite the good xml modules to do it.my $regex = /<title>(.*?)<\/title>\n<link>(.*?)<\/link>\n<description> +(.*?)\n<\/description>/; while ($data =~ /$regex/g) { #... }
LWP::Simple is just as optional as the XML modules, which you should be able to use. There is even one for rss.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Writing a simple RSS aggregator.
by duff (Parson) on Dec 06, 2003 at 03:40 UTC |