CPS::Governor::Simple - iterate immediately as fast as possible
CPS::Governor::Simple
use CPS qw( gkforeach ); use CPS::Governor::Simple; my $gov = CPS::Governor::Simple->new; gkforeach( $gov, [ 1 .. 10 ], sub { my ( $item, $knext ) = @_; print "$item\n"; goto &$knext; }, sub {}, );
This CPS::Governor allows the functions using it to run as fast as possible. It invokes its continuations immediately using a tailcall, so as not to let the stack grow arbitrarily.
Its constructor takes no special arguments, and it provides no other methods beyond those of CPS::Governor.
CPS::Governor
Paul Evans <leonerd@leonerd.org.uk>
To install CPS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPS
CPAN shell
perl -MCPAN -e shell install CPS
For more information on module installation, please visit the detailed CPAN module installation guide.