Perl: Variable Name Prefix: Sigil
in Perl, every variable name must start with one of DOLLAR SIGN $, COMMERCIAL AT @, PERCENT SIGN % .
$
means the VALUE of the variable is a “scalar”. i.e. string, number.@
means the VALUE of the variable is a array.%
means the VALUE of the variable is a hash table (aka dictionary, associative list.).
# -*- 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};