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;
To create and assign more than one variable, use the following pattern:
my ($name, $age) = 'Carl', 36;
Complete the quizzes that cover the contents of this topic.
💪 Or jump directly to the exercises to this section.