Course of Raku / Essentials / Functions essentials / Built-in functions for printing
put
By default, the put routine does the same job as print but adds a newline at the
end:
- Converts its arguments to a string by calling the
Strmethod on them. - Adds a newline character.
- Sends it to the
STDOUTstream.
A few examples:
42.put;
put 'Alpha', 'Beta';
my @array = 3, 4, 5;
put @array;
my %hash = a => 'b', c => 'd';
%hash.put;The outputs of the program:
$ raku t.raku
42
AlphaBeta
3 4 5
a b
c d%%tipblock ## A newline of put
The actual characters that are added after the output are taken from
the nl-out method of the output stream. Its default value
is \n. %%/tipblock
Course navigation
💪 Or jump directly to the
exercises in this section.
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська