GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DATA::STAG::HASHDB (3)

.ds Aq ’

NAME



  Data::Stag::HashDB - build indexes over Stag files or objects



CONTENTS

SYNOPSIS



  # parsing a file into a hash
  my $hdb = Data::Stag::HashDB->new;
  $hdb->unique_key("ss_details/social_security_no");
  $hdb->record_type("person");
  my $obj = {};
  $hdb->index_hash($obj);
  Data::Stag->parse(-file=>$fn, -handler=>$hdb);
  my $person = $obj->{999-9999-9999};
  print $person->xml;

  # indexing an existing stag tree into a hash
  my $personset = Data::Stag->parse($fn);
  my $hdb = Data::Stag::HashDB->new;
  $hdb->unique_key("ss_details/social_security_no");
  $hdb->record_type("person");
  my $obj = {};
  $hdb->index_hash($obj);
  $personset->sax($hdb);
  my $person = $obj->{999-9999-9999};
  print $person->xml;



DESCRIPTION

Used for building indexes over Stag files or objects

You need to provide a <B>record_typeB> - this is the type of element that will be indexed

You need to provide a unique_key - this is a single value used to index the <B>record_typeB>s

For example, if we have data in the stag structure below, and if ss_no is unique (we assume it is) then we can index all the people in the database using the code above



  publicinfo:
    persondata:
      person:
        ss_details:
          social_security_no:
        name:
        address:



There is a subclass of this method callsed Data::Stag::StagDB, which makes the hash persistent

PUBLIC METHODS -

    record_type



  Usage   -
  Returns -
  Args    -



    unique_key



  Usage   -
  Returns -
  Args    -



    index_hash



  Usage   -
  Returns -
  Args    -



POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 40: Deleting unknown formatting code N<>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DATA::STAG::HASHDB (3) 2013-09-18

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.