Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

XML::RSS question

by Anonymous Monk
on Jun 28, 2002 at 20:31 UTC ( #178131=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I wrote a small script to publish an rss document using XML::RSS. I used some of the code from the cpan documentation to write my script. It works great except this one little problem I am having. When my xml file gets to 15 items it does not remove the oldest and insert a new entry. Thanks in advance!
$rss->parsefile($rss_output); pop(@{$rss->{'items'}}) if (@{$rss->{'items'}} == 15); $rss->add_item(title => $title, link => $rss_link, description => $desc, mode => 'insert' );

Replies are listed 'Best First'.
Re: XML::RSS question
by mikeirw (Pilgrim) on Jun 28, 2002 at 21:27 UTC
    Hmmm...the code looks right. What exactly does it do when your RSS file contains 15 headlines?
      Nothing =) It doesn't add any new entries or delete any old ones.
        I'm not sure what the problem is with the code you've posted. Are you trying to write out a RSS file, or just read one in? Can you post the rest of your script?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://178131]
Approved by erikharrison
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2023-06-01 19:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?