Global Special Filehandles

ARGV

The special filehandle that iterates over command-line filenames in @ARGV. Usually written as the null filehandle in <>.

STDERR

The special filehandle for standard error in any package.

STDIN

The special filehandle for standard input in any package.

STDOUT

The special filehandle for standard output in any package.

DATA

The special filehandle that refers to anything following the _ _END_ _ token in the file containing the script. Or the special filehandle for anything following the _ _DATA_ _ token in a required file, as long as you’re reading data in the same package _ _DATA_ _ was found in.

_ (underscore)

The special filehandle used to cache the information from the last stat, lstat, or file test operator.

Get Perl in a Nutshell, 2nd Edition 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.