# single value
$var = 23;

# array
@var = (42, 371);
$size = @var;

# dictionary
%var = (371, 'PL', 386, 'networks', 389, 'AI');

print "a value: $var\n";

################################################################################
# array demo
print "an array: @var has size $size\n";

foreach (@var) {
   print "array contains: $_\n";
}

print "1st element of array: $var[1]\n";
$[ = 1; # now we are 1-based indexing
print "1st element of array: $var[1]\n";

################################################################################
# dictionary demo
@keys = keys %var;
foreach (@keys) {
   print "CS $_ is $var{$_}\n";
}

################################################################################
# regular expressions demo
$_ = 'hello world';
s/l/YES/g;
chop;
print;
print "\n";
