Tony Bowden > Spreadsheet-Engine-0.14 > Spreadsheet::Engine

Download:
Spreadsheet-Engine-0.14.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.14   Source  

NAME ^

Spreadsheet::Engine - Core calculation engine for a spreadsheet

SYNOPSIS ^

  use Spreadsheet::Engine;
  
  my $sheet = Spreadsheet::Engine->new;
  my $sheet = Spreadsheet::Engine->load_data([@data]);

  $sheet->execute('set A1 value n 2');
  $sheet->execute('set A2 value n 4');
  $sheet->execute('set A3 formula SUM(A1:A2)');
  $sheet->recalc;

  my $data = $sheet->raw;
  print $data->{datavalues}{A3}; # 6

DESCRIPTION ^

This provides back-end spreadsheet functionality for creating a sheet, setting cells to have values or formulae, and performing all necessary calculations. There is no front-end UI provided - this is purely the calculation engine.

Over 110 spreadsheet functions are provided: see Spreadsheet::Engine::Function::* and Spreadsheet::Engine::Functions for the full list.

METHODS ^

new

  my $sheet = Spreadsheet::Engine->new;

Instantiate a new blank spreadsheet.

load_data

  my $sheet = Spreadsheet::Engine->load_data([@data]);

Instantiate a sheet from lines of data in the saved file format (see Spreadsheet::Engine::Sheet for documentation)

execute

  $sheet->execute('set A1 value n 2');
  $sheet->execute('set A2 value n 4');
  $sheet->execute('set A3 formula SUM(A1:A2)');

Execute the given command against the sheet. See Spreadsheet::Engine::Sheet for documentation of commands.

recalc

  $sheet->recalc;

Recalculate the values for all formulae in the sheet. This never happens automatically - it must be explicitly called.

raw

  my $data = $sheet->raw;
  print $data->{datavalues}{A3}; # 6

Access the raw datastructure for the sheet. This is a temporary method until we provide proper accessors to the underlying data.

WARNING ^

Although the core underlying code is relatively mature and featureful, there will be significant interface changes and refactoring going forward with this version. As well as any bugs in the original SocialCalc code, the process of rearranging the code is likely to introduce more.

There is a reasonably complete test suite for most of the functions, but much of the other code is as yet untested. (See 'coverage.txt' in the root directory of the distribution for a little more detail).

Please pay close attention to the CHANGES file if you upgrade this package.

OPEN FORMULA SPECIFICATION ^

Spreadsheet::Engine attemps to conform as closely as possible to the Open Formula specification and provide all the features of the "Small" group as defined there. Divergences from that are detailed below. It is hoped to add the extra functionality of the "Medium" and "Large" groups eventually, but the initial work is on refactoring the code base to make it easier for users to plug in their own extensions to provide more of that functionality.

The latest version of the specification can be found at http://www.oasis-open.org/committees/office

EXTRAS ^

On top of the "Small" group functionality the following features are provided:

KNOWN BUGS AND SHORTCOMINGS ^

We do not meet the Open Formula specification at the following sections:

FIXED

HISTORY ^

The original Spreadsheet::Engine code was taken from SocialCalc version 1.1.0, which in turn originated as wikiCalc(R) version 1.0.

AUTHORS ^

Spreadsheet::Engine is developed and maintained by Tony Bowden <tony@tmtm.com>

SocialCalc 1.1.0 was developed by Dan Bricklin, Casey West, and Tony Bowden, at Socialtext, Inc.

wikiCalc was developed by Dan Bricklin, at Software Garden, Inc.

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. Some Rights Reserved.

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

syntax highlighting: