--- name: print status: documented runtime: pp source: src/runtime/pp/io.rs --- ```{index} single: print; Perl built-in (pp runtime) ``` # print ## Synopsis ```perl print "hello world\n"; print STDERR "error message\n"; print $fh @data; print @array; # uses $, and $\ ``` ## Description Outputs a list of values to a filehandle. Pops values from the stack and writes them to the target filehandle. When the STACKED flag is set, the first value after the mark is the filehandle; otherwise, STDOUT is used. The output field separator `$,` (`$OFS`) is inserted between values, and the output record separator `$\` (`$ORS`) is appended after all values. For `say` (which shares this implementation), a newline is always appended after the output. Supports Gv (typeglob), bareword string, and lexical (integer ID) filehandle forms. In-memory filehandles (`open my $fh, '>', \$buf`) write to the backing buffer. Returns 1 on success (Perl convention). ## See also say, printf, write, perlvar