1Data::Stag::StagDB(3) User Contributed Perl DocumentationData::Stag::StagDB(3)
2
3
4
6 Data::Stag::StagDB - persistent storage and retrieval of stag nodes
7
9 # parsing a file into a file based index
10 my $sdb = Data::Stag::StagDB->new;
11 $sdb->unique_key("ss_details/social_security_no");
12 $sdb->record_type("person");
13 $sdb->indexfile("./person_by_ss-idx");
14 Data::Stag->parse(-file=>$fn, -handler=>$sdb);
15 my $obj = $sdb->index_hash;
16 my $person = $obj->{'999-9999-9999'};
17 print $person->xml;
18
19 # indexing an existing stag tree into a file based index
20 my $personset = Data::Stag->parse($fn);
21 my $sdb = Data::Stag::StagDB->new;
22 $sdb->unique_key("ss_details/social_security_no");
23 $sdb->record_type("person");
24 $sdb->indexfile("./person_by_ss-idx");
25 $personset->sax($sdb);
26 my $obj = $sdb->index_hash;
27 my $person = $obj->{'999-9999-9999'};
28 print $person->xml;
29
31 This module is an extension of Data::Stag::HashDB - you can use it in
32 the same way.
33
34 It creates a simple file based database of stag nodes
35
36 This is useful if you want your data to persist; or if you want to use
37 Data::Stag::HashDB but your data will not fit into memory
38
40 indexfile
41 Usage -
42 Returns -
43 Args -
44
45
46
47perl v5.28.1 2013-09-18 Data::Stag::StagDB(3)