NAME

Sweet::File::DSV

SYNOPSIS

Given a file.dat in your home dir.

FIELD_A|FIELD_B
foo|bar
2|3

Create a pipe separated value file instance.

my $dir  = Sweet::HomeDir->new;
my $file = Sweet::File::DSV->new(
    dir  => $dir,
    name => 'file.dat',
    sep  => '|',
);

ATTRIBUTES

sep

Field separator.

METHODS

num_rows

field

say $file->field(0); # FIELD_A
say $file->field(1); # FIELD_B

fields

rows

say $_ for $file->rows;
# foo|bar
# 2|3

SEE ALSO

Delimiter-separated values Wikipedia page.