Data::Stag::HashDB man page on Pidora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Pidora logo
[printable version]

Data::Stag::HashDB(3) User Contributed Perl DocumentationData::Stag::HashDB(3)

NAME
	 Data::Stag::HashDB

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 record_type - 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 record_types

       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! The above document had some coding errors, which are explained
       below:

       Around line 40:
	   Deleting unknown formatting code N<>

perl v5.14.1			  2008-06-03		 Data::Stag::HashDB(3)
[top]

List of man pages available for Pidora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net