Clarion - Perl extension for reading CLARION data files |
Clarion - Perl extension for reading CLARION data files
This is a perl module to access CLARION 2.1 files. At the moment only read access to the files are provided by this package. ``Encrypted'' files are processed transparently, you do not need to specify the password of a file.
use Clarion;
my $dbh=new Clarion "customer.dat";
print $dbh->file_struct;
for ( 1 .. $dbh->last_record ) { my $r=$dbh->get_record_hash($_); next if $r->{_DELETED}; print $r->{CODE}." ".$r->{NAME}." ".$r->{PHONE}."\n"; }
$dbh->close();
The various methods that are supported by this module are given below.
This will create an object $dbh
that will be used to interact
with the various methods the module provides. If file name is specified
then associate the DAT file with the object. ``Encrypted'' files are
processed transparently, you do not need to specify the password of a file.
Associate the DAT file with the object, opens file.
Returns a list of data (field values) from the specified record. The first parameter in the call is the number of the physical record. If you do not specify any other parameters, all fields are returned in the same order as they appear in the file. You can also put list of field names after the record number and then only those will be returned. The first value of the returned list is always the logical (0 or not 0) value saying whether the record is deleted or not.
Returns reference to hash containing field values indexed by field names.
The name of the deleted flag is _DELETED
. The first parameter in the call is the number of the physical record. If
you do not specify any other parameters, all fields are returned. You can
also put list of field names after the record number and then only those
will be returned.
Returns the number of recods in the database file.
Returns the physical number of first logical record.
Returns the physical number of last logical record.
This closes the database file that are associated with the $dbh.
This returns CLARION file structure.
None.
Ilya Chelpanov <ilya@macro.ru> http://i72.narod.ru, http://i72.by.ru
Clarion data files and indexes description at http://i72.by.ru.
Clarion - Perl extension for reading CLARION data files |