MLDBM-TinyDB

 view release on metacpan or  search on metacpan

lib/MLDBM/TinyDB.pm  view on Meta::CPAN

	## or
	($aref_of_href, @get_recs_indices) = $obj{TABLE}->get_ext_recs;

	$aref_of_href1 = $obj{TABLE}->get_recs; ## NOT THE SAME AS ABOVE
	## or
	($aref_of_href1, @get_recs_indices1) =  $obj{TABLE}->get_recs;

	@indices_of_recs_found = $obj{TABLE}->search($criteria, [$limit]);
	@indices_of_recs_found = $obj{TABLE}->lsearch($criteria, [$limit]);
	
	@indices_and_sort_field_values = $obj{TABLE}->sort($sort_formula_string);
	@indices_and_sort_field_values = $obj{TABLE}->lsort($sort_formula_string);
	
	$obj{TABLEn}->delete([LIST]); 
	$obj{TABLEn}->last;


=head1 DESCRIPTION

MLDBM::TinyDB is MLDBM based module. It allows to create/manipulate data structure 
of related tables = more-then-flatfile-database. The main idea is to create array 
reference which will reflect database structure. The first scalar value in the array 

lib/MLDBM/TinyDB.pm  view on Meta::CPAN

perl expressions. IMPORTANT: The use of fields names that are interior tables names  
(SEE: C<down> method) will take no effect. Second (optional) argument is $limit, 
which defines what number of record indices matching the criteria should be at most returned.
C<lsearch> differs from C<search> method in one way - it uses C<locale> pragma -
it uses system locale settings in string comparison/matching operations.

=item sort 

=item lsort

Sort the all records of table associated with object according to C<$sort_formula_string> which
must be specified. Returns array of array references, where each pointed array contains 
as first element index of record followed by sorted fields values in order they appear in 
C<$sort_formula_string>. Sort formula string is similar to perl sort function BLOCK 
i.e. C<< a(field_name) <=> b(field_name) >> - in this case C<field_name> value will be 
second element of each pointed array C<< a(field_name1) cmp b(field_name1)||length a(field_test2) <=> length b(field_test2) >>
- in this case C<field_name1> and C<field_name2> value will be second and third
element of each pointed array. If empty array is returned then something went wrong.
C<lsort> differs from C<sort> method in one way - it uses C<locale> pragma - it sorts
lexically in system locale sorting order.

=item delete

Deletes records of specified indices or all records if no arguments. If for record to



( run in 0.287 second using v1.01-cache-2.11-cpan-26ccb49234f )