Algorithm-Dependency-MapReduce

 view release on metacpan or  search on metacpan

inc/Module/Install.pm  view on Meta::CPAN

use FindBin;

sub autoload {
	my $self = shift;
	my $who  = $self->_caller;
	my $cwd  = Cwd::cwd();
	my $sym  = "${who}::AUTOLOAD";
	$sym->{$cwd} = sub {
		my $pwd = Cwd::cwd();
		if ( my $code = $sym->{$pwd} ) {
			# Delegate back to parent dirs
			goto &$code unless $cwd eq $pwd;
		}
		$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
		my $method = $1;
		if ( uc($method) eq $method ) {
			# Do nothing
			return;
		} elsif ( $method =~ /^_/ and $self->can($method) ) {
			# Dispatch to the root M:I class
			return $self->$method(@_);

lib/Algorithm/Dependency/MapReduce.pm  view on Meta::CPAN

	my %args  = @_;

	# Check params
	unless ( _CODE($args{'map'}) ) {
		Carp::croak("The 'map' param is not a CODE reference");
	}
	unless ( _CODE($args{'reduce'}) ) {
		Carp::croak("The 'reduce' param is not a CODE reference");
	}

	# Hand off to the parent constructor
	my $self = $class->SUPER::new(@_);

	# Add the extra attributes
	$self->{'map'}    = $args{'map'};
	$self->{'reduce'} = $args{'reduce'};

	return $self;
}

sub mapreduce {



( run in 1.057 second using v1.01-cache-2.11-cpan-a5abf4f5562 )