Algorithm-LatticePoints
view release on metacpan or search on metacpan
lib/Algorithm/LatticePoints.pm view on Meta::CPAN
use strict;
use warnings;
require Exporter;
our $VERSION = sprintf "%d.%02d", q$Revision: 0.1 $ =~ /(\d+)/g;
sub new($&){
my $class = shift;
my $coderef = shift;
bless $coderef, $class;
}
sub visit{
my $self = shift;
my ( $start, $end ) = @_;
my $loop = 'LOOP';
$loop =~ s{LOOP}{
"for my \$i$_ (\$start->[$_]..\$end->[$_]){LOOP}"
}ex for ( 0 .. @$start - 1 );
my $args = join ",", map { '$i' . $_ } reverse( 0 .. @$start - 1 );
( run in 0.371 second using v1.01-cache-2.11-cpan-de7293f3b23 )