NAME
Text::LTSV - Labeled Tab Separeted Value manipulator
SYNOPSIS
use Text::LTSV;
my $p = Text::LTSV->new;
my $hash = $p->parse_line("hoge:foo\tbar:baz\n");
is $hash->{hoge}, 'foo';
is $hash->{bar}, 'baz';
my $data = $p->parse_file('./t/test.ltsv'); # or parse_file_utf8
is $data->[0]->{hoge}, 'foo';
is $data->[0]->{bar}, 'baz';
# Only want certain fields?
my $p = Text::LTSV->new;
$p->want_fields('hoge');
$p->parse_line("hoge:foo\tbar:baz\n");
my $ltsv = Text::LTSV->new(
hoge => 'foo',
bar => 'baz',
);
is $ltsv->to_s, "hoge:foo\tbar:baz";
DESCRIPTION
Labeled Tab Separated Value http://stanaka.hatenablog.com/entry/2013/02/05/214833 is a Key-Value pair + line-based text format for log files, especially HTTP access_log.
This module provides a simple way to process LSTV-based string and files, which converts Key-Value pair(s) of LSTV to Perl's hash reference(s).
AUTHOR
Naoya Ito <i.naoya@gmail.com>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.