You are viewing the version of this documentation from Perl 5.38.3. View the latest version
print

Prints a string or a list of strings. Returns true if successful. FILEHANDLE may be a scalar variable containing the name of or a reference to the filehandle, thus introducing one level of indirection. (NOTE: If FILEHANDLE is a variable and the next token is a term, it may be misinterpreted as an operator unless you interpose a + or put parentheses around the arguments.) If FILEHANDLE is omitted, prints to the last selected (see select) output handle. If LIST is omitted, prints $_ to the currently selected output handle. To use FILEHANDLE alone to print the content of $_ to it, you must use a bareword filehandle like FH, not an indirect one like $fh. To set the default output handle to something other than STDOUT, use the select operation.

The current value of $, (if any) is printed between each LIST item. The current value of