This software enables the accessing of specific lines within a file through the use of an array.
Notably, the module saves memory by reading the file's content only when the user accesses an element of the array, rather than loading the entire file at once. The offset and length of all lines remain stored in memory as long as the array remains tied.
It's important to note that the underlying file is opened for reading in binary mode to account for different OSs' interpretations of End-Of-Line (EOL) sequences and End-Of-File (EOF) characters. Bytes read are neither translated nor suppressed.
Array::LineReader builds lines up to and including the EOL-sequence, which is assumed to be either "x0Dx0A," "x0Ax0D," "x0D," or "x0A." The file remains open until the user unties the array.
The module provides three different methods for accessing the offset and content of every line as tuple or hash references via the elements of the array. The SYNOPSIS provides clear examples of each method, demonstrating the module's user-friendliness and adaptability to different use cases.
In short, Array::LineReader is an excellent solution for efficiently accessing lines of a file in Perl, providing both flexibility and memory efficiency.
Version 1.01: N/A