Cool File & Directory Modules IO::File 13 of 69 : prev | index | next

IO::File

A much safe method:

    use IO::File;
    if( my $fh = new IO::File "file", "r" ) {
        print <$fh>;
        $fh->close;
    }
  • Don't need the $fh->close
  • As soon as $fh goes out of scope the file is closed for you.

© 2003 Barbie - barbie@missbarbell.co.uk contents http://birmingham.pm.org/