ETLp::File::Read - Open a file and read a line when requested
use ETLp::File::Read; my $fh = ETLp::File::Read->new( filename => "/data/comit/final.csv", ); while (my $line = $fh->get_line) { print $fh->line_counter() .": " . $line, "\n"; };
Create a File object.
Parameters
Hash or hashref consisting of
* directory: optional. The directory where the file resides * filename: required. Name of the file to be opened. Requires full path to the file is the directory is not supplied * localize: optional. Whether to localize line endings.
Returns
* a ETLp::File::Read object
Return the line number last read from the file
None
A postive integer
gets the next line from the file.
A line's content. The Record separator (EOL character) is removed
Copyright 2010 Redbone Systems Ltd
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
The terms are in the LICENSE file that accompanies this application
To install ETLp, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ETLp
CPAN shell
perl -MCPAN -e shell install ETLp
For more information on module installation, please visit the detailed CPAN module installation guide.