More complicatedly we can set constructed lists equal to each other |
($a, @fred) = @fred; # sets $a to first element of @fred and removes this first element from @fred |
($a,$b,$c) = (1,2,3); # sets $a=1, $b=2, $c=3 |
Curiously setting a scalar equal to an array returns length of array |
$a = @fred; # returns $a as length of @fred whereas |
The function length returns number of characters in a string |
$a = length (@fred); # returns length in characters of first entry in @fred |
($a) = @fred; # defines two lists equal to each other but as LHS only has one element, this instruction sets $a to be first entry of @fred |