Vnlog::Parser(3pm)

πŸ“¦
version 1.42 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

Vnlog::Parser β€” a whole lil library that parses vnlog data, and honestly? it's giving simple. bestie, this is the Vnlog::Parser page from the vnlog manual, and we're gonna go through it together πŸ’–


🌸 SYNOPSIS 🌸

okay so here's the whole vibe in code, no notes:

 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}";
 }

like… that's it. that's the whole thing. iconic πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so this is a simple perl script that parses vnlog input and makes the incoming key/values available to you. the example up there? that's representative of normal use, fr fr. lowkey all you need.

the API functions are:

  • new() β€” creates a new Vnlog::Parser object. takes no arguments, she simply exists πŸ’…
  • parse(line) β€” the method you call for each input line. on error, a false value is returned. so like, check it, bestie.
  • error() β€” if an error occurred, this returns a string that describes the error. your emotional support error message 🫢
  • getKeys() β€” returns a list-ref containing the current column labels, or undef if this hasn't been parsed yet. no keys yet? undef. that's just where we're at.
  • getValues() β€” returns a list-ref containing the values for the current line, or undef if there aren't any. and listen: that's not necessarily an error, because the line could've been a comment. empty fields are '-' in the vnlog and undef in the values returned here. periodt.
  • getValuesHash() β€” returns a hash-ref containing the key-value mapping for the current line, or undef if there's no data in this line. again, not necessarily an error β€” this line could have been a comment. empty fields are '-' in the vnlog and undef in the values returned here. same energy as above, different data structure πŸ’œ
yes the original list really does end with an empty bullet. she's mysterious. she's a blank. we respect her πŸ«‘πŸ’€

πŸ”₯ REPOSITORY πŸ”₯

the source lives at <https://github.com/dkogan/vnlog> β€” go look, go star it, go vibe check it ⭐


πŸ‘‘ AUTHOR πŸ‘‘

Dima Kogan, "<dima@secretsauce.net>" β€” the main character who wrote this 🌈


Copyright 2016 California Institute of Technology.

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.

like yes, go ahead and redistribute and/or modify it, just keep the LGPL terms, okay? read the license, it's right there 🧚


and that's the whole page, bestie!! 🌸✨ this was Vnlog::Parser(3pm) from the vnlog manual, dated 2026-01-26 β€” love that for us. mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from