Course of Raku / Essentials / Scalar variables

Declaration with initialization

If you know the value that you want to put in a variable at the time the variable is created, you can gain a line of code and write it in a single statement:

my $name = 'Anna';
say $name;

Multiple variables

To create and assign more than one variable, use the following pattern:

my ($name, $age) = 'Carl', 36;

Course navigation

Scalar variables / Assigning a value   |   Scalar variables / The defined-or operator


💪 Or jump directly to the exercises to this section.