Perl @ variable

Code examples

1
0

perl variables

# 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",
);

Similar pages

Similar pages with examples

In other languages

This page is in other languages

Русский
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................