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 ); };