Perl relies heavily on punctuation for variables, operators, regular expressions, and code structure. This guide is for engineers who want a quick but accurate reference to common symbols and how they are used in real Perl scripts.
Originally published on 2014-07-22; fully revised and updated.
Source post: Commonly Used Sign- Punctuation and their Name in Perl.

Quick reference: punctuation names and typical Perl usage
The table below focuses on symbols commonly seen in Perl code. Some marks from the original post are typographic symbols rather than core Perl syntax, and are marked as such.
| Symbol | Common name | Typical Perl use | Example |
|---|---|---|---|
| => | Fat comma (comma arrow) | Readable key/value pairs in hashes | team => "platform" |
| $ | Dollar sign (scalar sigil) | Single scalar value | my $count = 3; |
| @ | At sign (array sigil) | Ordered list values | my @hosts = (...); |
| % | Percent sign (hash sigil) | Key/value map | my %cfg = (...); |
| ; | Semicolon | Statement terminator | print "ok"; |
| , | Comma | List separator | (1, 2, 3) |
| : | Colon | Ternary and labels | $a ? $b : $c |
| ( ) | Parentheses | Grouping, function arguments | print($msg) |
| [ ] | Square brackets | Array indexing and array refs | $arr[0] |
| { } | Curly braces | Hash access, blocks, hash refs | $h{key} |
| / | Slash | Regex delimiter and division | $s =~ /err/ |
| \ | Backslash | Escaping in strings and regex | " and \n |
| =~ | Binding operator | Apply regex to a scalar | $line =~ /timeout/ |
| ! | Exclamation mark | Logical negation | if (!$ok) { ... } |
| ? | Question mark | Ternary operator | $x ? "yes" : "no" |
| | | Pipe / vertical bar | Bitwise OR, regex alternation | /warn|error/ |
| & | Ampersand | Bitwise AND, optional sub call style | $a & $b |
| ^ | Caret | Bitwise XOR, regex start anchor | /^INFO/ |
| < , > | Less-than / greater-than | Numeric comparisons | $n > 10 |
| – | Hyphen-minus | Subtraction, unary minus | $a - $b |
| _ | Underscore | Common in identifiers | my $build_id |
| ‘ and “ | Quotation marks | String delimiters | 'raw' vs "interp $x" |
| ′ ″ 〃 | Prime / double-prime / ditto mark | Typographic marks; uncommon in Perl syntax | Prefer plain ASCII symbols in source |
Compare quoting forms in Perl
| Form | Interpolation | Best for | Example |
|---|---|---|---|
| Single quotes | No variable interpolation | Literal strings | 'path/$HOME' |
| Double quotes | Yes | Strings with variables or escapes | "user=$user\n" |
q{...} | No | Literal strings with fewer escapes | q{/var/log/app} |
qq{...} | Yes | Interpolated strings with custom delimiters | qq{host=$host} |
Practical Perl examples
use strict;
use warnings;
my $service = "api";
my @ports = (8080, 8081);
my %owner = (
team => "platform",
lead => "alex",
);
print "$service\n";
print "$ports[0]\n";
print "$owner{team}\n";Code language: PHP (php)
my $count = 12;
if ($count > 10 && $count < 20) {
print "in range\n";
}
my $line = "error: timeout";
if ($line =~ /timeout/) {
print "matched\n";
}Code language: PHP (php)
perl -c script.plCode language: CSS (css)
Decision flow: choosing the right sigil
flowchart TD
A[Need a variable] --> B{Data shape}
B -->|Single value| C[Use dollar sigil]
B -->|Ordered list| D[Use at sigil]
B -->|Key value map| E[Use percent sigil]
C --> F[Access scalar directly]
D --> G[Access by index]
E --> H[Access by key]
Common pitfalls and best practices
- Avoid smart quotes and look-alike Unicode punctuation in source files; Perl code is safest with plain ASCII symbols.
- Do not confuse sigils (
$,@,%) with operators; sigils identify variable type context. - Use
=>in hash literals for readability, especially in config-like data. - Keep
use strict;anduse warnings;enabled to catch punctuation-related mistakes early. - Run
perl -cbefore committing to catch syntax errors quickly.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals