Finance::OFX::Parse::Simple - Parse a simple OFX file or scalar


Finance-OFX-Parse-Simple documentation  | view source Contained in the Finance-OFX-Parse-Simple distribution.

Index


NAME

Top

Finance::OFX::Parse::Simple - Parse a simple OFX file or scalar

VERSION

Top

Version 0.06

SYNOPSIS

Top

   use Finance::OFX::Parse::Simple;

   my $parser = Finance::OFX::Parse::Simple->new;

   my $data_from_file     = $parser->parse_file("myfile.ofx"); # returns a reference to a list of hash references

   my $data_from_scalar   = $parser->parse_scalar($ofx_data); 

METHODS

Top

new

Create a new parser object.

parse_file

Takes a filename as an argument, slurps the file into memory, parses it and returns a reference to a list of hash references. Each hash reference contains two keys: 'account_id' which is the account number, and 'transactions' which is a reference to a list of hash references, each containing details for a single transaction.

Returns false if no filename was provided, the file is not a plain file, or the file is not openable.

parse_scalar

Takes a scalar as an argument containing OFX data. Returns a reference to a list of hash references. Each hash reference contains two keys: 'account_id' which is the account number, and 'transactions' which is a reference to a list of hash references, each containing details for a single transaction.

Returns false if no non-empty scalar is provided.

NOTES

Top

The decimal point character (e.g. . or ,) can be configured before parsing OFX data so that it is handled correctly:

If the environment variable MON_DECIMAL_POINT exists then this is used as the decimal point separator. Failing that, the module will try to use the locale setting of the local system, through the POSIX module. As a last resort a . is used as the separator.

If you are working with OFX data from multiple sources, you can control the separator by setting the MON_DECIMAL_POINT environment variable before parsing each dataset, e.g.:

 $ENV{MON_DECIMAL_POINT} = '.';
 my $transactions_in_america = $parser->parse_file("bank-of-america.ofx");

 local $ENV{MON_DECIMAL_POINT} = ',';
 my $transactions_in_germany = $parser->parse_file("deutsche-bank.ofx");

AUTHOR

Top

Jeremy Jones, <jjones at cpan.org>

BUGS

Top

Please report bugs and feature requests to bug-finance-ofx-parse-simple at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Finance-OFX-Parse-Simple.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc Finance::OFX::Parse::Simple

The latest version of this module is available on Github:

    http://github.com/JeremyJones/Finance--OFX--Parse--Simple

You can also look for information at:

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Finance-OFX-Parse-Simple

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Finance-OFX-Parse-Simple

* CPAN Ratings

http://cpanratings.perl.org/d/Finance-OFX-Parse-Simple

* Search CPAN

http://search.cpan.org/dist/Finance-OFX-Parse-Simple/

COPYRIGHT & LICENSE

Top


Finance-OFX-Parse-Simple documentation  | view source Contained in the Finance-OFX-Parse-Simple distribution.