Perl Sigils

[Solved] Perl Sigils | Perl - Code Explorer | yomemimo.com
Question : perl sigils

Answered by : charlesalexandre-roy

# Basic syntax:
# In Perl, variables generally start with one of $, @, or % (called sigils)
# Scalars (strings, floats, ints) start with $, e.g.:
my $scalar_variable = "This string";
# Arrays (lists) start with @
my @array_variable = (2.3, 42, "Word");
# Hashes (dictionaries) start with % and use "key => value" to assign mappings
my %hash_variable = ( 42 => "The answer", mice => "vast, hyper-intelligent pan-dimensional beings",
);

Source : https://stackoverflow.com/questions/1091634/why-do-perl-variables-need-to-start-with-sigils | Last Update : Thu, 10 Mar 22

Answers related to perl sigils

Code Explorer Popular Question For Perl