Perl: Variable Name Prefix: Sigil

By Xah Lee. Date: .

in Perl, every variable name must start with one of DOLLAR SIGN $, COMMERCIAL AT @, PERCENT SIGN % .

# -*- coding: utf-8 -*-
# perl

use Data::Dumper;   # for printing array and hash
$Data::Dumper::Indent = 0;  # set to print compact

$aa = 4; # scalar
@aa = (1, 2, 3); # array
%aa = ('e' => 4, 'f' => 5, 'g' => 6); # hash

print $aa, "\n"; # 4
print Dumper(\@aa), "\n";  # $VAR1 = [1,2,3];
print Dumper(\%aa), "\n";  # $VAR1 = {'e' => 4,'g' => 6,'f' => 5};

Perl

Detail

String

Boolean

Conditional

Data Structure

Loop, Iteration

Function

Text Processing

Advanced

misc