Launcher::Cascade::FileReader::Seekable - a filereader that memorizes its position between reads.


Launcher-Cascade documentation  | view source Contained in the Launcher-Cascade distribution.

Index


NAME

Top

Launcher::Cascade::FileReader::Seekable - a filereader that memorizes its position between reads.

SYNOPSIS

Top

    use Launcher::Cascade::FileReader::Seekable;

    my $f = new Launcher::Cascade::FileReader -path => ... ;

    my $fh1 = $f->open();
    my $line1 = <$fh1>; # first line
    $f->close();

    # later, in a nearby piece of code

    my $fh2 = $f->open(); # different filehandle
    my $line2 = <$fh2>; # next line




DESCRIPTION

Top

Launcher::Cascade::FileReader::Seekable inherits from Launcher::Cascade::FileReader but keeps in memory the position where it was at when the filehandle is closed. Subsequent calls to open() will perform the necessary operations to resume reading where it last stopped, be it when reading a local file, or a remote file through ssh.

Attributes

position

Methods

close

Stores the filehandle's position in the position() attribute, then closes the filehandle.

open

Opens the file (locally or remotely), seeks to the desired position() and returns a filehandle.

BUGS AND CAVEATS

Top

SEE ALSO

Top

Launcher::Cascade::FileReader

AUTHOR

Top

Cédric Bouvier <cbouvi@cpan.org>

COPYRIGHT & LICENSE

Top


Launcher-Cascade documentation  | view source Contained in the Launcher-Cascade distribution.