IO::File(3p) Perl Programmers Reference Guide IO::File(3p)
IO::File(3p) Perl Programmers Reference Guide IO::File(3p) # IO::File(3p) Perl Programmers Reference Guide IO::File(3p) NNAAMMEE # IO::File - supply object methods for filehandles SSYYNNOOPPSSIISS # use IO::File; $fh = IO::File->new(); if ($fh->open("< file")) { print <$fh>; $fh->close; } $fh = IO::File->new("> file"); if (defined $fh) { print $fh "bar\n"; $fh->close; } $fh = IO::File->new("file", "r"); if (defined $fh) { print <$fh>; undef $fh; # automatically closes the file } $fh = IO::File->new("file", O_WRONLY|O_APPEND); if (defined $fh) { print $fh "corge\n"; $pos = $fh->getpos; $fh->setpos($pos); undef $fh; # automatically closes the file } autoflush STDOUT 1; DDEESSCCRRIIPPTTIIOONN # "IO::File" inherits from "IO::Handle" and "IO::Seekable". ...