CodeBase
view release on metacpan or search on metacpan
CodeBase.pm view on Meta::CPAN
$fh->new_record({ firstname => "Fred",
surname => "Bloggs" });
or a reference to a hash, the keys of which are
the field names:
$fh->new_record("Bloggs", "Fred");
If the values are supplied as an array, a value must be supplied for
each field. If the values are supplied as a hash unspecified fields
are filled with blanks. Excess array values or hash keys that are not
names of fields are simply ignored. The handling of date fields is as
described under C<set_field>.
=item replace_record VALUES
Replaces the fields of the current record with the values specified.
As with C<new_record> C<VALUES> may be an array of field values:
$fh->replace_record("Bloggs", "Fred");
or a reference to a hash, the keys of which are the field names.
$fh->replace_record({ firstname => "Fred",
surname => "Bloggs" });
In the former case a value must be supplied for each field, while in
the latter case unspecified fields are unchanged. Excess values or
hash keys that are not names of fields are ignored. The handling of
date fields is as described under C<set_field>.
=item deleted
Returns a boolean value indicating whether the current record is
deleted.
if ($fh->deleted()) ...
This function is equivalent to the dBASE C<DELETED()> function.
=item delete_record [RECNO]
Deletes the record specified or the current record if called without a record number.
$fh->delete_record($recno);
=item recall_record [RECNO]
Recalls the record specified or the current record if called without a
record number. (Not yet implemented).
=item flush [TRIES]
Flushes to file any outstanding changes (made by C<set_field()>.
Records need to be locked while changes are written. C<TRIES> is the
number of attempts that should be made to aquire the lock. Subsequent
attempts are made with a one second interval.
=item pack COMPRESS-MEMO-FLAG
Packs the database file removing deleted records. If flag parameter
is specified as true then memo fields are compressed at the same time:
$fh->pack(1);
=item lock WHAT [, TRIES]
Locks the specified record or the whole file. C<WHAT> should either
be C<"FILE"> or a record number (the current record can be referred to
as C<".">. C<TRIES> is the number of attempts that should be made to
aquire the lock. Subsequent attempts are made with a one second
interval.
=item unlock
Removes any existing locks on the file.
=back
=head2 Index Handling Functions
A production index file is automatically opened when a database file
is opened, if it exists unless the C<noindex> option is specified.
An index file can be opened with the C<open_index> method.
=over 4
=item tagcount
Returns the number of index tags.
$n_tags = $fh->tagcount();
=item tags
Returns an array containing the names of all the tags associated with
the database file.
@tags = $fh->tags();
=item set_tag TAG
Sets the current index tag to the named tag. If no tag is specified
the currently selected tag is deselected.
$fh->set_tag("TAG1") || die "Cannot set index tag.\n";
=item taginfo
( run in 0.838 second using v1.01-cache-2.11-cpan-e1769b4cff6 )