Perl Diver 2.31
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

IO::InnerFile

Name IO::InnerFile
Version 2.113
Located at /usr/local/share/perl5
File /usr/local/share/perl5/IO/InnerFile.pm
Is Core No
Search CPAN for this module IO::InnerFile
Documentation IO::InnerFile
Module Details IO::InnerFile

NAME

IO::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>) {
        # ...
    }


DESCRIPTION

If you have a file handle that can seek and tell, then you can open an the IO::InnerFile manpage on a range of the underlying file.


CONSTRUCTORS

the IO::InnerFile manpage 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 the IO::InnerFile manpage 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.


METHODS

the IO::InnerFile manpage 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.

binmode

    $inner->binmode();

This is a NOOP method just to satisfy the normal the IO::File manpage interface.

close

fileno

    $inner->fileno();

This is a NOOP method just to satisfy the normal the IO::File manpage interface.

flush

    $inner->flush();

This is a NOOP method just to satisfy the normal the IO::File manpage interface.

get_end

    my $num_bytes = $inner->get_end();

Get the virtual end position of the inner file in bytes.

get_length

    my $num_bytes = $inner->get_length();

Get the virtual length of the inner file in bytes.

get_start

    my $num_bytes = $inner->get_start();

Get the virtual position of the inner file in bytes.

getc

getline

print LIST

printf

read

readline

seek

set_end

    $inner->set_end(30);

Set the virtual end of the inner file in bytes (this basically just alters the length).

set_length

    $inner->set_length(30);

Set the virtual length of the inner file in bytes.

set_start

    $inner->set_start(30);

Set the virtual start position of the inner file in bytes.

tell

write


AUTHOR

Eryq (eryq@zeegee.com). President, ZeeGee Software Inc (http://www.zeegee.com).


CONTRIBUTORS

Dianne Skoll (dfs@roaringpenguin.com).


COPYRIGHT & LICENSE

Copyright (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.

Perl Diver brought to you by ScriptSolutions.com © 1997- 2024