Standard Files

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email

In an effort to make programs more uniform, there are three connections that always Exist when your program starts. These are STDIN, STDOUT, and STDERR. Actually, these names are file handles. File handles are variables used to manipulate files. Just like you need to grab the handle of a hot pot before you can pick it up, you need a file handle before you can use a file,

The Standard File Handles

STDIN -Reads program input. Typically this is the computer's keyboard. STDOUT - Displays program output, This is usually the computer's monitor.

STDERR - Displays program errors. Most of the time, it is equivalent to STDOUT, which means the error messages will be displayed on the computer's monitor.

You've been using the STDOUT file handle without knowing it for every print() statement. The print() function uses STDOUT as the default if no other file handle is specified.

Using STDIN

Reading a line of input from the standard input, STDIN, is one of the easiest things that you can do in Perl. This following three line program will read a line from the keyboard and then display it. This will continue until you press CtrI+Z on DOS systems or Ctrl D on UNIX systems.

To read the Standard Input Until an End-of-file Character is Found
While(STDIN){
print();
}



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.