The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Spreadsheet::Engine::Function::counter - base class for counting functions

SYNOPSIS

  use base 'Spreadsheet::Engine::Function::count';

  sub calculate { 
    return sub { 
      my $type = shift;
      return is_match($type)
    };
  }

DESCRIPTION

This provides a base class for spreadsheet functions that count the number of values in a list that match a certain type (COUNT, COUNTA, COUNTBLANK, etc).

METHODS

argument_count

By default all such functions take one or more argument.

result_type

This is always a number.

TO SUBCLASS

calculate

Returns a subref that is given each type in turn and returns a true/false value for whether or not it should be counted in the total.

HISTORY

This is a Modified Version of code extracted from SocialCalc::Functions in SocialCalc 1.1.0

COPYRIGHT

Portions (c) Copyright 2005, 2006, 2007 Software Garden, Inc. All Rights Reserved.

Portions (c) Copyright 2007 Socialtext, Inc. All Rights Reserved.

Portions (c) Copyright 2007, 2008 Tony Bowden

LICENCE

The contents of this file are subject to the Artistic License 2.0; you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.perlfoundation.org/artistic_license_2_0