my $ / @ / %
The sigil determines the variable type.
Syntax
my $skaler; my @arr; my %hash;
Description
$ is used for single values (scalars), @ for arr, % for hash. Local variables are defined with my. use strict; is a good practice.
Example
Loading editor…
Expected output
HexLibrary - 1
When to use?
Storing all kinds of data.
Common mistakes
- ⚠️ Single element of array $arr[0] (sigil becomes $, not @).