ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl5-porters
perl5-porters
Re: Every.pm on CPAN
by David Nicol other posts by this author
Jul 18 2008 12:16PM messages near this date
Re: Every.pm on CPAN | Re: Every.pm on CPAN
On Fri, Jul 18, 2008 at 1:19 PM, Gisle Aas <gisle@[...].com>  wrote:

> > it's really useful and the common (if $i % 5 == 0) format has lots of
> > shortcomings;
> 
>  What would those shortcoming be?  I've never been bothered by that idiom.

me neither.  The following may or may not work today, but demonstrates
what Macrame's EXPAND is all about.

   use Macrame;
   macro every(N) {
         EXPAND {
                $Macrame::Expand::EveryInstanceCounter++;
                my $count;

*{"Macrame::Expand::EveryInstance".$Macrame::Expand::EveryInstanceCounter}
= sub {
                     ! ( ++$count % N )
                };


"(&Macrame::Expand::EveryInstance".$Macrame::Expand::EveryInstanceCounter.")"
         }
   }
   macro every N { every (N) }
Thread:
Ted Zlatanov
Abigail
Ted Zlatanov
Ben Morrow
Roland Giersig
David Nicol
Ted Zlatanov
Ted Zlatanov
David Nicol
Ben Morrow
Ted Zlatanov
Chromatic
Aristotle Pagaltzis
Nicholas Clark
Yitzchak Scott-Thoennes
David Nicol
Ted Zlatanov
Abigail
Ted Zlatanov
Abigail
David Nicol
Ted Zlatanov
Aristotle Pagaltzis
Ted Zlatanov
David Cantrell
David Nicol
Eric Wilhelm
David Nicol
Ben Morrow
Aristotle Pagaltzis
Paul Johnson
David Nicol
Eric Brine
Gisle Aas
David Nicol
Nicholas Clark

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved