in reply to data types
my @array = ('hello', 'blah', 'bye'); my($scalar1) = @array; # $scalar1 eq 'hello' my $scalar2 = @array; # $scalar2 == 3 print join ' ', $scalar1, $scalar2;
The first works like a list assignment (list context) ($name, $last) = ($last, $name); assigning the first element of the array to $scalar1.
The second puts @array into scalar context which returns the length of the array into $scalar2.
-- Hofmator
|
|---|