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

NAME

IO::File::RecordStream - Read multi-line records from a file.

SYNOPSIS

    use Bio::RNA::Treekin;

DESCRIPTION

Auxiliary class to read records consisting of multiple lines, separated by a separator matching a specified regular expression.

METHODS

IO::File::RecordStream->new($file_name, @args)

IO::File::RecordStream->new($file_handle)

Construct a new record stream from a file name or handle.

Mandatory arguments:
file_name | file_handle

Name of or handle to file to read data from. Pass either

match_separator

Quoted regular expression matching the record separator. The input file is split at every match.

record_factory

A code ref that, when called with an array ref containing the lines of a single record, parses the data and constructs a record object.

Additionally, the constructor can be called with a single file name or file handle (without keyword). This requires to override the match_separator and record_factory attributes to provide default values.

$stream->next

Returns the next record object. Internally, the input file is read until the next match of the match_separator. The data is passed on to the record_factory and the returned record object is returned.

$stream->file_name

Return the name of the file that this object reads data from. May be undef if the data was read from a handle. Use predicate has_file_name to query its presence.

$stream->has_file_name

Predicate query whether a file name has been used to read the data.

$stream->file_handle

Handle to the file the data is being read from.

$stream->end_reached

Query whether the input file was read completely yet.

$stream->match_separator

Returns the matching expression used to identify the record separator.

AUTHOR

Felix Kuehnl, <felix@bioinf.uni-leipzig.de>

BUGS

Please report any bugs or feature requests by raising an issue at https://github.com/xileF1337/Bio-RNA-Treekin/issues.

You can also do so by mailing to bug-bio-rna-treekin at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bio-RNA-Treekin. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Bio::RNA::Treekin

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright 2019-2021 Felix Kühnl.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.