Built-in routines

say / print / put

Full

The three ways to write to standard output, and how each formats its argument.

Raku has three output routines that differ in how they format their argument and whether they add a newline: say (human-readable + newline), put (string + newline), and print (string, no newline).

say vs put #

say prints the gist — a readable summary — so a list shows in parentheses. put prints the plain string form, which for a list joins the elements with spaces. Both add a trailing newline.

say (1, 2, 3);
put (1, 2, 3);
Output
(1 2 3)
1 2 3

print writes its argument with no trailing newline and no gist formatting, so you control line breaks yourself.

print "a";
print "b";
print "\n";
Output
ab

Notes #