App::RecordStream::InputStream
Benjamin Bernard <perlhacker@benjaminbernard.com> Keith Amling <keith.amling@gmail.com>
This module will generate an stream of App::RecordStream::Record objects for given inputs.
use App::RecordStream::InputStream; my $stream = App::RecordStream::InputStream(STRING => $recs_string); while ( my $record = $stream->get_record() ) { ... do stuff ... }
The input stream takes named paramters, it will take one of: FILE, STRING, or FH (a file handle).
FILE - Name of a file, must be readable STRING - String of new line separated records FH - File handle to a stream of data
Optionally, it wil take a NEXT argument. The NEXT argument should be another InputStream object. Once the returned object reaches the end of its string, it will get records from the NEXT App::RecordStream::InputStream. In this manner, InputStream objects can be chained
returns an instance of InputStream
Provides GNU-style input semantics for scripts. If there are arguments left in @ARGV, it will assume those are file names and make a set of chained streams for those files, returning the first stream. If no files are specified, will open an InputStream on STDIN
Takes an array of FILES and constructs a set of chained streams for those files. Returns the first stream
Retrieve the next App::RecordStream::Record from the stream. Will return a false value if no records are available. If this stream has a NEXT stream specified in the constructor, this will continue to return Record objects until all chained streams are exhausted
To install App::RecordStream, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::RecordStream
CPAN shell
perl -MCPAN -e shell install App::RecordStream
For more information on module installation, please visit the detailed CPAN module installation guide.