Vnlog::Parser(3pm)

Vnlog::Parser3pm

Simple library to parse vnlog data

Usage

 use Vnlog::Parser;
 my $parser = Vnlog::Parser->new();
 while (<DATA>)
 {
     if( !$parser->parse($_) )
     {
         die "Error parsing vnlog line '$_': " . $parser->error();
     }
     my $d = $parser->getValuesHash();
     next unless %$d;
     say "$d->{time}: $d->{height}";
 }

Overview

This is a simple perl script to parse vnlog input and make the incoming key/values available. The example above is representative of normal use. API functions are

•

new()

Creates new Vnlog::Parser object. Takes no arguments.

•

parse(line)

Method to call for each input line. On error, a false value is returned.

•

error()

If an error occurred, returns a string that describes the error.

•

getKeys()

Returns a list-ref containing the current column labels or undef if this hasn't been parsed yet.

•

getValues()

Returns a list-ref containing the values for the current line or undef if there aren't any. This isn't an error necessarily because this line could have been a comment. Empty fields are '-' in the vnlog and undef in the values returned here.

•

getValuesHash()

Returns a hash-ref containing the key-value mapping for the current line or undef if there's no data in this line. This isn't an error necessarily because this line could have been a comment. Empty fields are '-' in the vnlog and undef in the values returned here.

•

Repository

<https://github.com/dkogan/vnlog>

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Author

Dima Kogan, "<[email protected]>"

From libvnlog-perl 1.40-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.