Skip Menu |

This queue is for tickets about the Every CPAN distribution.

Report information
The Basics
Id: 41818
Status: open
Priority: 0/
Queue: Every

People
Owner: Nobody in particular
Requestors: jpierce [...] cpan.org
Cc:
AdminCc:

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



Subject: Add iteration support
This module would be more useful if it also provided a facile mechanism (perhaps an iterator) to return truth every N invocations...
On Thu Dec 18 23:02:57 2008, JPIERCE wrote: Show quoted text
> This module would be more useful if it also provided a facile mechanism > (perhaps an iterator) to return truth every N invocations...
I'm so sorry I missed this ticket, Jerrad. Apologies. Do you mean a tied variable that can be passed around? You can do that more easily with the optional identifier you can pass to every(). Or am I misunderstanding? Thanks Ted
Subject: Re: [rt.cpan.org #41818] Add iteration support
Date: Fri, 02 Apr 2010 14:58:40 -0400
To: bug-Every [...] rt.cpan.org
From: Jerrad Pierce <belg4mit [...] pthbb.org>
It's been so long I cannot recall. Reading it now, my guess would be that the every(N) cycles form satisfies this, but that at the time I interepreted cycles as relating to the processor rather than rounds of the loop. Clearer wording might help, as could the canonical example of every(2) to alternate row colors in the synopsis. -- Free map of local environmental resources: http://CambridgeMA.GreenMap.org -- MOTD on Boomtime, the 19th of Discord, in the YOLD 3176: Snoochie Boochie Noochies!
I made two changes, one in the example: print_stats() if every(20); # every 20 cycles ($_ is 19, 39, etc.) and one in the docs, marked with >>>: =head1 FUNCTION-ORIENTED INTERFACE =head2 every( $number [, @id] ) =head2 every( seconds => $number [, @id] ) Returns true every C<$number> times it's called, or every time C<$number> seconds have elapsed since the last time it was called. Show quoted text
>>> Note the first (0) cycle doesn't count.
I think that's OK, do you think it's understandable? Also should I make the 0 count (for alternating table rows, for example) optionally active? I haven't needed that but maybe you and others do. Ted
Subject: Re: [rt.cpan.org #41818] Add iteration support
Date: Tue, 06 Apr 2010 11:18:03 -0400
To: bug-Every [...] rt.cpan.org
From: Jerrad Pierce <belg4mit [...] pthbb.org>
Show quoted text
>Also should I make the 0 count (for alternating table rows, for example) >optionally active? I haven't needed that but maybe you and others do.
I don't see any particular need for it, but if implemented it would probably be better as a more general 'offset' to count from, which then defaults to 0. -- Free map of local environmental resources: http://CambridgeMA.GreenMap.org -- MOTD on Sweetmorn, the 23rd of Discord, in the YOLD 3176: spam spam spam spam spam spam spam spam lovely spam