ETL::Pipeline::Output::Perl - Execute arbitrary Perl code against every record
use ETL::Pipeline; ETL::Pipeline->new( { input => ['UnitTest'], mapping => {First => 'Header1', Second => 'Header2'}, output => ['Perl', code => sub { say $_->{First} }] } )->process;
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.
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.
This method doesn't do anything. There's nothing to close or shut down.
This method doesn't do anything. There's nothing to open or setup.
Executes the subroutine in "code". The arguments are passed directly into the subroutine.
ETL::Pipeline, ETL::Pipeline::Output
Robert Wohlfarth <robert.j.wohlfarth@vumc.org>
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.
To install ETL::Pipeline, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ETL::Pipeline
CPAN shell
perl -MCPAN -e shell install ETL::Pipeline
For more information on module installation, please visit the detailed CPAN module installation guide.