Finance::OFX::Parse::Simple - Parse a simple OFX file or scalar
Version 0.06
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);
Create a new parser object.
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.
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.
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");
Jeremy Jones, <jjones at cpan.org>
<jjones at cpan.org>
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.
bug-finance-ofx-parse-simple at rt.cpan.org
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 2009-10 Jeremy Jones, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Finance::OFX::Parse::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::OFX::Parse::Simple
CPAN shell
perl -MCPAN -e shell install Finance::OFX::Parse::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.