.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Vnlog::Parser 3pm" .TH Vnlog::Parser 3pm 2024-02-29 "" vnlog .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Vnlog::Parser \- Simple library to parse vnlog data .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Vnlog::Parser; \& \& my $parser = Vnlog::Parser\->new(); \& while () \& { \& if( !$parser\->parse($_) ) \& { \& die "Error parsing vnlog line \*(Aq$_\*(Aq: " . $parser\->error(); \& } \& \& my $d = $parser\->getValuesHash(); \& next unless %$d; \& \& say "$d\->{time}: $d\->{height}"; \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" 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 .IP \(bu 4 \&\fBnew()\fR .Sp Creates new Vnlog::Parser object. Takes no arguments. .IP \(bu 4 parse(line) .Sp Method to call for each input line. On error, a false value is returned. .IP \(bu 4 \&\fBerror()\fR .Sp If an error occurred, returns a string that describes the error. .IP \(bu 4 \&\fBgetKeys()\fR .Sp Returns a list-ref containing the current column labels or undef if this hasn't been parsed yet. .IP \(bu 4 \&\fBgetValues()\fR .Sp 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. .IP \(bu 4 \&\fBgetValuesHash()\fR .Sp 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. .IP \(bu 4 .SH REPOSITORY .IX Header "REPOSITORY" .SH AUTHOR .IX Header "AUTHOR" Dima Kogan, \f(CW\*(C`\*(C'\fR .SH "LICENSE AND COPYRIGHT" .IX Header "LICENSE AND COPYRIGHT" Copyright 2016 California Institute of Technology. .PP This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.