IO::Handle

IO::Handle

NAME

IO::Handle - supply object methods for I/O handles

SYNOPSIS

use IO::Handle;

$io = IO::Handle->new();
if ($io->fdopen(fileno(STDIN),"r")) {
    print $io->getline;
    $io->close;
}

$io = IO::Handle->new();
if ($io->fdopen(fileno(STDOUT),"w")) {
    $io->print("Some text\n");
}

# setvbuf is not available by default on Perls 5.8.0 and later.
use IO::Handle '_IOLBF';
$io->setvbuf($buffer_var, _IOLBF, 1024);

undef $io;       # automatically closes the file if it's o