HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to PerlOperatorsStringsArrays (@)Hashes (%)Conditions (if)LoopsFunctions (sub)
REFERENCE
📖 Overview
🖥️ Output
📦 Variables
my $ / @ / %
✍️ Text & Number
📋 Array & Hash
🔁 Condition & Loop
🧩 Function (sub)
Perl›REFERENCE›Variables›my $ / @ / %

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 @).

Related commands

print
HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code