NAME

Finance::Pershing::StandardFile - Base Standard File class

SYNOPSIS

ATTRIBUTES

filename

Required read-only string that represents the path to the file you wish to read.

record_callback

has_record_callback - predicate

Optional read-only code reference that will be called after every logical record is read. Will be passed two arguments, the current instance of the file parser (so you can access file properties) and a hashref representing the record as described above.

You can use this to reduce the memory foot print of your program by keeping only the current account record in memory. Example:

my $callback = sub{
    my($instance, $rec) = @_;
    #process data here;
    %$rec = ();
};
my $file = Finance::Pershing::StandardFile:XYZ
  ->load( filename => $file, record_callback => $callback);

#by the time this returns a callback will have been executed for each account
my $recs = eval { $balance->records };
defined($recs) && !$@ ? commit() : rollback() and die($@);

The downside of this method is that if the file is currupted, you will have to catch the exception and rollback changes. Partially transmitted files are NOT that uncommon! Make sure you have a rollback mechanism.

records

clear_records - clearer
has_records - predicate
_build_records - builder

An array reference containing all of the positions contained in the file. This read-only attribute builds lazyly the first time it is requested by actually going through the while file and reading it. If any errors are encountered while reading the file or the file appears to be truncated an exception will be thrown.

File Properties

The following attributes are automatically filled the header is read:

file_type - String
file_type - String =item run_date - DateTime =item data_date - DateTime =item remote_id - String
record_count - Integer, number of records in file not including header, and trailer records.

_file_handle

_clear_file_handle - clearer
_has_file_handle - predicate
_build__file_handle - builder

This is the IO::File object that holds our filehandle. DO NOT TOUCH THIS. If you mess with this I can almost guarantee you will break something.

AUTHOR & LICENSE

Please see Finance::Pershing::StandardFiles for more information.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 194:

'=item' outside of any '=over'