Filehandle Special Variables

Most of these variables apply only when using formats. See Section 4.11 later in this chapter.

$|$OUTPUT_AUTOFLUSH

If set to nonzero, forces an fflush(3) after every write or print on the currently selected output channel.

$%$FORMAT_PAGE_NUMBER

The current page number of the currently selected output channel.

$=$FORMAT_LINES_PER_PAGE

The current page length (printable lines) of the currently selected output channel. Default is 60.

$-$FORMAT_LINES_LEFT

The number of lines left on the page of the currently selected output channel.

$~$FORMAT_NAME

The name of the current report format for the currently selected output channel. Default is the name of the filehandle.

$^$FORMAT_TOP_NAME

The name of the current top-of-page format for the currently selected output channel. Default is the name of the filehandle with _TOP appended.

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.