***** infoCopter.com/perl *****
Dealing with Files
open FILEHANDLE,MODE,LIST open FILEHANDLE,EXPR open FILEHANDLE
[ Rewind the STDIN file handle ]
If MODE is '<' or nothing, the file is opened for input. If MODE is '>', the file is truncated and opened for output, being created if necessary. If MODE is '>>', the file is opened for appending, again being created if necessary. You can put a '+' in front of the '>' or '<' to indicate that you want both read and write access to the file; thus '+<' is almost always preferred for read/write updates--the '+>' mode would clobber the file first. You can't usually use either read-write mode for updating textfiles, since they have variable length records.
See also
File::chmod
File::chmod is a utility that allows you to bypass system calls or bit processing of a file's permissions. It overloads the chmod() function with its own that gets an octal mode, a symbolic mode, or an %22ls%22 mode. If you wish not to overload chmod(), you can export symchmod() and lschmod(), which take, respectively, a symbolic mode and an %22ls%22 mode.
File::PathConvert
File::PathConvert provides conversions from absolute to relative and back again for URLs, Unix, DOS, MacOS, and VMS. [POD]
File::Slurp
File::Slurp provides single call read and write file routines and the ability to read directories.
File::Sort
Written primarily for MacPerl users who do not have sort(1) and because of memory limitations cannot sort files in memory, but works on all Perls.
File::Spec
This module is designed to support operations commonly performed on file specifications (usually called %22file names%22, but not to be confused with the contents of a file, or Perl's file handles), such as concatenating several directory and file names into a single path, or determining whether a path is rooted.
File::Sync
File::Sync provides Perl interfaces to the Unix sync(2) and POSIX.1b fsync(2) system calls. The fsync() call is needed for putting messages into qmail maildirs, and sync() is included for completeness.
File::Tail
The File::Tail package is designed for reading files which are continously appended to (the name comes from the tail -f directive). Usualy such files are logfiles of some description. The package tries not to busy wait on the file, dynamicaly calcultaing how long it should wait before it pays to try reading the file again. Currently this package requires Time::HiRes, because it often needs to sleep for less than one second.
File::Temp
File::Temp can be used to create and open temporary files in a safe way. The tempfile() function can be used to return the name and the open filehandle of a temporary file. The tempdir() function can be used to create a temporary directory.
|