Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

printf

Formats and prints a list of values to a filehandle using a format string.

Equivalent to print FILEHANDLE sprintf(FORMAT, LIST). Formats the list of values according to FORMAT (see sprintf for format specifiers) and writes the result to the specified filehandle (or STDOUT if none is given).

Like print, honors $\ (output record separator), which is appended after the formatted output. The filehandle is determined by the stacked flag on the op, exactly as in pp_print.

Internally delegates to pp_sprintf for formatting, then writes the resulting string to the filehandle.

Synopsis

printf FORMAT, LIST;
printf FILEHANDLE FORMAT, LIST;

See Also

sprintf, print, say