Introducing UNIX and Linux |
PerlOverview |
Input and outputA feature of the shell is that input and output, as simple data streams, are fundamental to its working. In other languages, such as Java or C, input and output can be much more complex, and the programmer needs to be aware of the type of data they are reading in or sending to an output device or file. For example, if a program were to write data to many different files, then a shell program that relied on redirection of the standard output stream would become unwieldy and difficult to write. Perl retains the simplicity of the shell whilst allowing the programmer a greater variety of methods for reading and writing data. It is equipped with five predefined variables for input and output (known as filehandles):
|
Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck