NAME

Data::Record::Serialize::Encode::array - encoded a record as /rdb

VERSION

version 1.07

SYNOPSIS

use Data::Record::Serialize;

my $s = Data::Record::Serialize->new( encode => 'array', ... );

$s->send( \%record );

DESCRIPTION

Data::Record::Serialize::Encode::array encodes a record as a Perl arrayref. The first array output will contain the field names.

For example,

my @output;
$s = Data::Record::Serialize->new(
    encode  => 'array',
    sink    => 'array',
    output  => \@output,
    fields  => [ 'integer', 'number', 'string1', 'string2', 'bool' ],
);

$s->send( {
    integer => 1,
    number  => 2.2,
    string1 => 'string',
    string2 => 'nyuck nyuck',
} );

results in

@output = (
  ["integer", "number", "string1", "string2", "bool"],
  [1, 2.2, "string", "nyuck nyuck", undef],
)

It performs the Data::Record::Serialize::Role::Encode role.

INTERNALS

INTERFACE

There are no additional attributes which may be passed to Data::Record::Serialize->new|Data::Record::Serialize/new>.

SUPPORT

Bugs

Please report any bugs or feature requests to bug-data-record-serialize@rt.cpan.org or through the web interface at: https://rt.cpan.org/Public/Dist/Display.html?Name=Data-Record-Serialize

Source

Source is available at

https://gitlab.com/djerius/data-record-serialize

and may be cloned from

https://gitlab.com/djerius/data-record-serialize.git

SEE ALSO

Please see those modules/websites for more information related to this module.

AUTHOR

Diab Jerius <djerius@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory.

This is free software, licensed under:

The GNU General Public License, Version 3, June 2007