|
NAMEIO::InnerFile - define a file inside another file SYNOPSIS use strict;
use warnings;
use IO::InnerFile;
# Read a subset of a file:
my $fh = _some_file_handle;
my $start = 10;
my $length = 50;
my $inner = IO::InnerFile->new($fh, $start, $length);
while (my $line = <$inner>) {
# ...
}
DESCRIPTIONIf you have a file handle that can "seek" and "tell", then you can open an IO::InnerFile on a range of the underlying file. CONSTRUCTORSIO::InnerFile implements the following constructors. new my $inner = IO::InnerFile->new($fh);
$inner = IO::InnerFile->new($fh, 10);
$inner = IO::InnerFile->new($fh, 10, 50);
Create a new IO::InnerFile opened on the given file handle. The file handle supplied MUST be able to both "seek" and "tell". The second and third parameters are start and length. Both are defaulted to zero (0). Negative values are silently coerced to zero. METHODSIO::InnerFile implements the following methods. add_length$inner->add_length(30); Add to the virtual length of the inner file by the number given in bytes. add_start$inner->add_start(30); Add to the virtual position of the inner file by the number given in bytes. set_end$inner->set_end(30); Set the virtual end of the inner file in bytes (this basically just alters the length). AUTHOREryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com). CONTRIBUTORSDianne Skoll (dfs@roaringpenguin.com). COPYRIGHT & LICENSECopyright (c) 1997 Erik (Eryq) Dorfman, ZeeGee Software, Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|