Skip Menu |

This queue is for tickets about the XML-RSS CPAN distribution.

Report information
The Basics
Id: 39231
Status: resolved
Worked: 15 min
Priority: 0/
Queue: XML-RSS

People
Owner: SHLOMIF [...] cpan.org
Requestors: dave [...] dsb3.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: XML::RSS example incorrect / limited (should pop, not shift)
Date: Fri, 12 Sep 2008 15:33:45 -0400
To: bug-XML-RSS [...] rt.cpan.org
From: "Dave Baker" <dave [...] dsb3.com>
http://search.cpan.org/dist/XML-RSS/lib/XML/RSS.pm The following code fragment appears incorrect: # ... and removes the oldest item if there are already 15 items shift(@{$rss->{'items'}}) if (@{$rss->{'items'}} == 15); The shift() should be a pop() to remove the oldest, not the newest. Also it might be more expected to shrink to desired size rather than just take the top one off (hence the while, not the if). # ... shrink to limited number of items pop(@{$rss->{'items'}}) while (@{$rss->{'items'}} >= 15); Dave
Thanks for reporting it. This has been fixed in XML-RSS-1.34. Regards, -- Shlomi Fish
Subject: Re: [rt.cpan.org #39231] XML::RSS example incorrect / limited (should pop, not shift)
Date: Fri, 12 Sep 2008 17:03:00 -0400
To: bug-XML-RSS [...] rt.cpan.org
From: "Dave Baker" <dave [...] dsb3.com>
Thanks!
Resolving again - please don't reply so it won't be re-opened.