Sprog::Gear::PerlCodePA.3pm

Langue: en

Version: 2005-07-24 (mandriva - 01/05/08)

Section: 3 (Bibliothèques de fonctions)

NAME

Sprog::Gear::PerlCodePA - convert 'pipe' data to 'list' data via Perl code

DESCRIPTION

This gear is for converting line-by-line input to rows of field values. It allows the user to define a snippet of Perl code that will implement the conversion for each line of input. The code snippet is wrapped with a small amount of boilerplate code similar to the following:
   $_ = $input_line;
   @row = ();
   LINE: {
     # Perl snippet inserted here
     $self->msg_out(row => \@row) if @row;
   }
 
 

There is no default conversion, so if the code snippet does not assign to @row then no output message will be generated.

For consistency with other PerlCode gears, the scalar $r contains a reference to the @row.

Copyright 2004-2005 Grant McLean <grantm@cpan.org>

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