Code blocks are fragments of your program enclosed in a pair of curly braces:
}. They group a series of statements that work together as a kind of one big statement. We will see many use cases in the further sections.
say 'Hello, World!';
The presence of a code block in this program does not add much sense, but code blocks are quite useful in other situations, which we’ll cover very soon.
But first, let us examine the concept of scope.