The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

    BoutrosLab::TSVStream::IO::Role::Fixed

SYNOPSIS

        # in a Moose class definition...
        use MooseX::ClassAttribute

        class_has '_fields' => (
                is => 'ro',
                isa => 'ArrayRef',
                default => sub { [qw(foo bar)] }
                );

        # # or, without using MooseX::ClassAttribute
        # my $_fields = [ qw(foo bar) ];
        # sub _fields { return $_fields }

        with 'BoutrosLab::TSVStream::IO::Role::Fixed';

        has 'foo' => ( ... );
        has 'bar' => ( ... );
        ...

DESCRIPTION

This role provides methods to create a file/iostream reader/writer for a class, using a stream of lines with tab separated fields for each record, converting to/from an object of the class. Usually, the stream will start with an initial line that has the field names as a tab separated record.

This role is also provided a BUILDARGS wrapper that alows the constructor to be given one element pair in the parameter list: (field_values=>[val1,val2,...]) instead of providing each field explicitly by name as (fld1=>val1, fld2=>val2, ...). In such a case, the values in the field_values array must be in the same order as they are listed in the _fields class attribute.

AUTHOR

John Macdonald - Boutros Lab

ACKNOWLEDGEMENTS

Paul Boutros, Phd, PI - Boutros Lab

The Ontario Institute for Cancer Research