Course of Raku / Essentials / Variables and data types essentials
Scalar variables
So far, the programs we saw had hardcoded text strings. Let us introduce a bit of freedom and let the program use variables.
There are a few types of variables in Raku. A variable is a container
that can keep some data in it. We’ll start with the simplest containers
that can keep only a single value. Such containers are called
scalars or scalar variables. A variable has a name prefixed
with a special indicator that tells about the container’s nature. That
indicator is a character called sigil. For scalar containers,
such a sigil is a dollar character $.
Here are a couple of examples of scalar variables:
$name
$ageTopics in this section
Practice
Complete the quizzes that cover the contents of this section.
Exercises
This section contains 4 exercises. Examine all the topics of this section before doing the coding practice.
Course navigation
← Variables and data types essentials | Declaring a variable →
Translations of this page: English • Deutsch • Español • Italiano • Latviešu • Nederlands • Български • Русский • Українська