Search Perl pages
Professions, Sciences, Humanities, Business, ...
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...
Conversions, tests, processing, manipulation,...
Integer, Floating point, Matrix, Statistics, Boolean, ...
Algorithms, Memory, Process control, Debugging, ...
Data storage, Integrity, Encryption, Compression, ...
Networks, protocols, Interprocess, Remote, Client Server, ...
Timing, Calendar and Clock, Audio, Video, Printer, Controls...
Management, Filtering, File & Directory access, Viewers, ...
Next: closedir DIRHANDLE
Closes the file or pipe associated with the file handle, returning
TRUE only if stdio successfully flushes buffers and
closes the system file descriptor. If the file handle came from a piped
open close will additionally return
FALSE if one of the other system calls involved fails or if the program exits with non-zero status. (If the problem was that the program exited non-zero $! will be set to 0.) You don't have to close
FILEHANDLE if you are immediately going to do another |
open() on it, because
open() will close it for you. (See
open().) However, an explicit close on an input file resets the line counter ($.), while the implicit close done by
open() does not. Also, closing a pipe will wait for the process executing on the pipe to complete, in case you want to look at the output of the pipe afterwards. Closing a pipe explicitly also puts the status value of the command into
open(OUTPUT, '|sort >foo'); # pipe to sort
... # print stuff to output
close OUTPUT; # wait for sort to finish
open(INPUT, 'foo'); # get sort's results
FILEHANDLE may be an expression whose value gives the
real filehandle name.
Source: Perl builtin functions
Copyright: Larry Wall, et al.
Previous: chroot FILENAME
(Corrections, notes, and links courtesy of RocketAware.com)
Up to: File Access
Search | About | Comments | Submit Path: RocketAware > Perl >
RocketAware.com is a service of Mib Software
Copyright 2000, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments