NAME
NetHack::Logfile - Parse and create NetHack logfiles
VERSION
version 1.00
SYNOPSIS
use NetHack::Logfile ':all';
my @entries = read_logfile("logfile");
@entries = sort { $b->score <=> $a->score } @entries;
splice(@entries, 2000);
write_logfile(\@entries, "high-scores");
say $entries[0]->as_line;
DESCRIPTION
This module provides an easy way to read NetHack logfiles. You can also create logfiles.
This module's interface changed drastically from 0.01
to 1.00
.
Currently, NetHack versions 3.2.0 through 3.4.3 are supported. If you desire support for an older version, please open up a ticket on rt.cpan.org with some logfile entries for these older versions.
FUNCTIONS
read_logfile
Takes a file (default name: logfile) and parses it as a logfile. If any IO error occurs in reading the file, an exception is thrown. If any error occurs in parsing a logline, an exception is thrown.
This returns entries of class NetHack::Logfile::Entry. See that module for more information.
parse_logline
Shortcut for "new_from_line" in NetHack::Logfile::Entry.
write_logfile
Takes an arrayref of NetHack::Logfile::Entry objects and a filename (default name: logfile). If any IO error occurs, it will throw an exception.
Returns no useful value.
AUTHOR
Shawn M Moore, sartak@gmail.com