Skip Menu | You are currently an anonymous guest. | Login | Return to Main | About rt.cpan.org
 

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.

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

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

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



X History Display mode: Brief headersFull headers
#   Fri Sep 12 15:34:29 2008 dave[...]dsb3.com - Ticket created  
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>
[text/plain 526b]
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

#   Fri Sep 12 15:56:56 2008 SHLOMIF - Correspondence added 15 min  
[text/plain 87b]
Thanks for reporting it. This has been fixed in XML-RSS-1.34.

Regards,

-- Shlomi Fish
#   Fri Sep 12 15:56:59 2008 RT_System - Status changed from 'new' to 'open'  
#   Fri Sep 12 15:57:02 2008 SHLOMIF - Status changed from 'open' to 'resolved'  
#   Fri Sep 12 15:57:05 2008 SHLOMIF - Given to SHLOMIF  
#   Fri Sep 12 17:03:24 2008 dave[...]dsb3.com - Correspondence added  
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>
[text/plain 8b]
Thanks!

#   Fri Sep 12 17:03:25 2008 RT_System - Status changed from 'resolved' to 'open'  
#   Fri Sep 12 17:17:12 2008 SHLOMIF - Correspondence added  
[text/plain 62b]
Resolving again - please don't reply so it won't be re-opened.
#   Fri Sep 12 17:17:19 2008 SHLOMIF - Status changed from 'open' to 'resolved'