Scalar, array, and hash output
$salary=50000; # Scalar assignment
@months=('Mar', 'Apr', 'May'); # Array assignment
%states= ( # Hash assignment
'CA' => 'California',
'NM' => 'New Mexico',
);
print "$salary\n";
print "@months\n";
print "$months[0], $months[1], $months[2]\n";
print "$states{'CA'}, $states{'NM'}\n";
print $x + 3, "\n";
print "***$name***\n";
Related examples in the same category