© William "Bo" Rothwell of One Course Source, Inc. 2019
William "Bo" RothwellBeginning Perl Programminghttps://doi.org/10.1007/978-1-4842-5055-6_8

8. Advanced Input and Output

William “Bo” Rothwell1 
(1)
San Diego, CA, USA
 

Filehandles

A filehandle is a connection between your script and a “port.” There are four standard filehandles in Perl by default:

<STDIN>

Standard input

<>

Standard input or files listed on command line

STDOUT

Standard output

STDERR

Standard error

The <STDIN> and <> filehandles were covered in a previous chapter. The STDOUT filehandle is the port used to send messages to the screen. When you use the print statement, it sends the output to the STDOUT filehandle by default.

The STDERR filehandle will be discussed in the “The die and warn Functions” ...

Get Beginning Perl Programming: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.