Skip Menu |

This queue is for tickets about the CPAN-Recent-Uploads CPAN distribution.

Report information
The Basics
Id: 69119
Status: resolved
Worked: 30 min
Priority: 0/
Queue: CPAN-Recent-Uploads

People
Owner: BINGOS [...] cpan.org
Requestors: tour [...] jeroen.la
Cc:
AdminCc:

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



Subject: Module can be used only once per session
Because the current implementation of 'recent' modifies @times, it is not possible to call it multiple times in one session (well, it works a few times, but it will start to download increasingly bigger files until @times is finally empty). The attached patch resolves this.
Subject: repeatable.patch
--- Uploads.pm.orig 2011-06-28 14:28:48.296875000 +0200 +++ Uploads.pm 2011-06-28 14:30:04.781250000 +0200 @@ -33,10 +33,8 @@ my $period = _period_from_epoch( $epoch ); my $mirror = shift || $MIRROR; my %data; - my $finished; - OUTER: while( !$finished ) { - my $foo = shift @times; - $finished = 1 if $foo eq $period; + OUTER: foreach my $foo ( @times ) { + last if $foo eq $period; my $yaml = CPAN::Recent::Uploads::Retriever->retrieve( time => $foo, mirror => $mirror ); my @yaml; eval { @yaml = YAML::Syck::Load( $yaml ); };
Hi, I'm not entirely sure why I did it like that, thanks for spotting it. Patch applied and version 0.04 is on its way to CPAN. Many thanks.