Data::CHEF

Data::CHEF is a complex hash exchange format.
Download

Data::CHEF Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Chris Josephes
  • Publisher web site:
  • http://search.cpan.org/~chrisj/ubertext-0.95/Dispatch/Dispatch.pm

Data::CHEF Tags


Data::CHEF Description

Data::CHEF is a complex hash exchange format. Data::CHEF is a complex hash exchange format.SYNOPSISuse Data::CHEF;$chef=Data::CHEF->new();$chef->read(@text_array);$chef->readHash(%hash_table);$chef->set("name.full" => "John Public");$chef->get("name.first", "name.last");CHEF is a text format of a hash data structure that can be interchanged between programs. Data::CHEF is designed to read and write the CHEF format. The CHEF format can handle multiline records, hierarchial keys, and arrays.All access is performed by object methods. You can get/set values, perform basic hash operations, dump partial structures, and traverse the key (similar to how an snmp MIB is walked).DATA FORMATA simple key/value record is expressed like this: ==A key/value pair where the value spans multiple lines can be expressed like this: =>END-TAG END-TAGWhitespace at the start of a line is ignored. If you have a multiple line value that includes whitespace at the beginning of a line, you can use the vertical bar to indicate that it is to be preserved. =>|END-TAG | | | END-TAGThe keys in the CHEF format can be hierarchial, with levels of the hierarchy seperated by periods. name.first==Chris name.last==JosephesEach portion of the key is known as a segment.To reduce file size, hierarchial records in the CHEF format can be grouped together so the full path of the key doesn't need to be entered for every record.Here is the above example compressed: name={ first==Chris last==Josephes }A key segment is capable of being an array index. This is useful for serializing data, or if you are dealing with lists of identical records.The following is an example of array indexes being used in a CHEF file that contains data about a Compact Disc. cd.title==Pump cd.artist==Aerosmith cd.list={ (1).track==1 (1).index==1 (1).title==Young Lust < ..... > (5).track==5 (5).index==1 (5).title==Water Song (6).track==5 (6).index==2 (6).title==Janie's Got A Gun < ..... > }You can create an array of CHEF objects by using the spawnArray() method.A key segment can also be a hash index. system={ ={ name==Playstation 2 manufacturer==Sony } ={ name==Gamecube manufacturer==Nintendo } ={ name==X-Box manufacturer==Microsoft } }You can create a hash table of CHEF objects by using the spawnHash() method. Requirements: · Perl


Data::CHEF Related Software