Clarion - Perl module for reading CLARION 2.1 data files


Clarion documentation  | view source Contained in the Clarion distribution.

Index


NAME

Top

Clarion - Perl module for reading CLARION 2.1 data files

DESCRIPTION

Top

This is a perl module to access CLARION 2.1 files. At the moment only read access to the files is implemented. "Encrypted" (owned) files are processed transparently, there is no need to specify the password of a file.

SYNOPSIS

Top

	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();

METHODS

Top

$h=new Clarion ["file.dat" [, 1]]

Create object for reading Clarion file. 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.

If the third argument (skipMemo) specified, memo field will not be processed at all.

$h->close

Close all open file handles.

$h->open('file.dat' [, 1])

Read and parse header of Clarion file.

If second argument given, skip processing of memo field.

$n=$dbh->last_record;

Returns the number of records in the database file.

$n=$dbh->bof;

Returns the physical number of first logical record.

$n=$dbh->eof;

Returns the physical number of last logical record.

@r=$dbh->get_record([ $n [, @fields]]);

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.

If first argument is omited (or undef) then reads next record from file.

$r=$dbh->get_record_hash([ $n [, @fields]]);

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 (can be omited to read next record if avaialable). 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.

$struct = $dbh->file_struct;

This returns CLARION file structure as a string.

BUGS

Top

Tested only on x86 processors. Should fail on another architecture.

AUTHOR

Top

Stas Ukolov <ukoloff@cpan.org>

Ilya Chelpanov <ilya@macro.ru>, http://i72.narod.ru or http://i72.by.ru

COPYRIGHT

Top

SEE ALSO

Top

Clarion data files and indexes description at http://i72.by.ru.

ODBC driver for Clarion .tps-files (read/write) at http://dein.h11.ru/


Clarion documentation  | view source Contained in the Clarion distribution.