Perl programming on MPE/iX - February 2001

February 9, 2001
Solution Symposium
Page 5
hp e3000
perl
programming
variable names
scalar values
$days # the simple scalar value "days"
$days[28] # the 29th element of array @days
$days{'Feb'} # the 'Feb' value from hash %days
$#days # the last index of array @days
entire arrays or array slices (aka lists)
@days # ($days[0], $days[1],... $days[n])
@days[3,4,5] # same as @days[3..5]
@days{'a','c'} # same as ($days{'a'},$days{'c'})
entire hashes
%days # (key1, val1, key2, val2 ...)