Brad Baxter > FlatFile-DataStore-Lite-0.01 > FlatFile::DataStore::Lite::Record

Download:
FlatFile-DataStore-Lite-0.01.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.01   Source  

NAME ^

FlatFile::DataStore::Lite::Record - Perl module that implements a lightweight flat file data store record class.

SYNOPSYS ^

 # first, create a preamble object

 use FlatFile::DataStore::Lite::Preamble;

 my $preamble = FlatFile::DataStore::Lite::Preamble->new( {
     indicator => $indicator,  # single-character crud flag
     keynum    => $keynum,     # record sequence number (integer)
     reclen    => $reclen,     # record length (integer)
     thisfnum  => $fnum,       # file number (in base format)
     thisseek  => $datapos,    # seek position (integer)
     user      => $user_data,  # pre-formatted user-defined data
     } );

 # then create a record object with the preamble contained in it

 use FlatFile::DataStore::Lite::Record;

 my $record = FlatFile::DataStore::Lite::Record->new( {
     preamble => $preamble,                 # i.e., a preamble object
     data     => "This is a test record.",  # actual record data
     } );

DESCRIPTION ^

FlatFile::DataStore::Lite::Record is a Perl module that implements a lightweight flat file data store record class. This class defines objects used by FlatFile::DataStore::Lite. You will likely not ever call new() yourself, (FlatFile::DataStore::Lite::create() would, e.g., do that) but you will likely call the accessors.

VERSION ^

FlatFile::DataStore::Lite::Record version 0.01

CLASS METHODS ^

FlatFile::DataStore::Lite::Record->new( $parms )

Constructs a new FlatFile::DataStore::Lite::Record object.

The parm $parms is a hash reference containing key/value pairs to populate the record string. Two keys are recognized:

 - preamble, i.e., a FlatFile::DataStore::Lite::Preamble object
 - data,     the actual record data

The record data is stored as a scalar reference.

OBJECT METHODS: ACCESSORS ^

The following read/write methods set and return their respective attribute values if $value is given. Otherwise, they just return the value.

 $record->data(     [$value] ); # actual record data
 $record->preamble( [$value] ); # FlatFile::DataStore::Lite::Preamble object

The following read-only methods just return their respective values. The values all come from the record's contained preamble object.

 $record->user()
 $record->string()
 $record->indicator()
 $record->keynum()
 $record->reclen()
 $record->thisfnum()
 $record->thisseek()

AUTHOR ^

Brad Baxter, <bbaxter@cpan.org>

COPYRIGHT AND LICENSE ^

Copyright (C) 2009 by Brad Baxter

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.