use IO::File;
$fh = new IO::File;
- if ($fh->open "< file") {
+ if ($fh->open("< file")) {
print <$fh>;
$fh->close;
}
- $fh = new IO::File "> FOO";
+ $fh = new IO::File "> file";
if (defined $fh) {
print $fh "bar\n";
$fh->close;
$fh = new IO::File "file", O_WRONLY|O_APPEND;
if (defined $fh) {
print $fh "corge\n";
- undef $fh; # automatically closes the file
- }
- $pos = $fh->getpos;
- $fh->setpos $pos;
+ $pos = $fh->getpos;
+ $fh->setpos($pos);
- $fh->setvbuf($buffer_var, _IOLBF, 1024);
+ undef $fh; # automatically closes the file
+ }
autoflush STDOUT 1;