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

NAME

ETL::Pipeline::Output::Perl - Execute arbitrary Perl code against every record

SYNOPSIS

  use ETL::Pipeline;
  ETL::Pipeline->new( {
    input   => ['UnitTest'],
    mapping => {First => 'Header1', Second => 'Header2'},
    output  => ['Perl', code => sub { say $_->{First} }]
  } )->process;

DESCRIPTION

ETL::Pipeline::Output::Perl runs arbitrary Perl code for every record. It comes in useful when debugging data issues or prototyping a new technique.

Your code receives two parameters - the ETL::Pipeline object and the current record. These are the same arguments passed to "write". The current record is a Perl hash reference.

METHODS & ATTRIBUTES

Arguments for "output" in ETL::Pipeline

code

Required. Assign a code reference to this attribute. The code receives two parameters. The first one is the ETL::Pipeline object. The second is a hash reference with the current record.

The code reference can do anything you want. If you need setup or shut down, then create a custom output destination instead.

Methods

close

This method doesn't do anything. There's nothing to close or shut down.

open

This method doesn't do anything. There's nothing to open or setup.

write

Executes the subroutine in "code". The arguments are passed directly into the subroutine.

SEE ALSO

ETL::Pipeline, ETL::Pipeline::Output

AUTHOR

Robert Wohlfarth <robert.j.wohlfarth@vumc.org>

LICENSE

Copyright 2021 (c) Vanderbilt University

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.