File::ANVL

A Name Value Language routines
Download

File::ANVL Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • John A. Kunze
  • Publisher web site:
  • http://search.cpan.org/~jak/

File::ANVL Tags


File::ANVL Description

File::ANVL is a Perl module that provides a general framework for data represented in the ANVL format. ANVL (A Name Value Language) represents elements in a label-colon-value format similar to email headers. Specific conversions, based on an "output multiplexer" File::OM, are possible to XML, Turtle, JSON, CSV, and PSV (Pipe Separated Value), and Plain unlabeled text.SYNOPSIS use File::ANVL; # to import routines into a Perl script xgetlines( # read from $filehandle (defaults to *ARGV) up to $filehandle # blank line; returns record read or undef on EOF; ); # record may be all whitespace (almost EOF) trimlines( # strip initial whitespace from record, often just $record, # returned by getlines(), and return remainder; $r_wslines, # optional ref to line count in trimmed whitespace $r_rrlines ); # optional ref to line count of real record lines anvl_recarray( # split $record into array of lineno-name-value $record, # triples, first triple being $r_elems, # reference to returned array $lineno, # starting line number (default 1) $opts ); # options/default, eg, comments/0, autoindent/1 erc_anvl_expand_array(# change short ERC ANVL array to long form ERC $r_elems ); # reference to array to modify in place anvl_arrayhash( # hash indices from recarray or expand_array $r_elems, # reference to original array (not modified) $r_hash ); # reference to hash (you undef to initialize) anvl_valsplit( # split ANVL value into an array of subvalues $value, # input value; arg 2 is reference to returned $r_svals ); # array of arrays of returned values anvl_decode( $str ); # decode ANVL-style %xy chars in string anvl_name_naturalize( # convert name from sort-friendly to natural $name ); # word order using ANVL inversion points anvl_om( # read and process records from *ARGV $om, # a File::OM formatting object { # a hash reference to various options autoindent => 0, # don't (default do) correct sloppy indention elem_order => 0, # ordered element name list (default all) to output comments => 1, # do (default don't) preserve input comments verbose => 1, # output record and line numbers (default don't) ... } ); # other options listed later anvl_opt_defaults(); # return hash reference with factory defaults *DEPRECATED* anvl_rechash( # split ANVL record into hash of elements $record, # input record; arg 2 is reference to returned $r_hash, # hash; a value is scalar, or array of scalars $strict ); # if more than one element shares its name anvl_recsplit( # split record into array of name-value pairs; $record, # input record; arg 2 is reference to returned $r_elems, # array; optional arg 3 (default 0) requires $strict ); # properly indented continuation lines anvl_encode( $str ); # ANVL-encode string *REPLACED* # instead of anvl_fmt use File::OM::ANVL object's 'elems' method $elem = anvl_fmt( # format ANVL element, wrapping to 72 columns $name, # $name is what goes to left of colon (:) $value, # $value is what goes to right of colon ... ); # more name/value pairs may followProduct's homepage


File::ANVL Related Software