Why is this difficult to understand?
my @foo = qw(1 2 3);
$foo[0] = 1;
you are referencing an array and returning a scalar. the sigil represents a scalar which is what is returned. A list isn't being returned, so why should the sigil represent that?
you are referencing an array and returning a scalar. the sigil represents a scalar which is what is returned. A list isn't being returned, so why should the sigil represent that?
Eliminate the unnecessary.
Example:
@array = qw(1 2 3); $length = @array;
print $length;
By allowing a non scalar to take an implicit scalar form, we have an extremely useful and quick way to get the length of an array. Nothing that difficult to replace with a len() call, but it's language features like these that make perl ($length = @_ may be the most useful of all) so handy for quick hacks.
That's a circular argument. So is "Why not require them when you need them?"