Patrick R. Michaud wrote:
my $foo = [ 42 ];
my $bar = { a => 23 };
$foo[1] = $bar;
TSa (Thomas Sandlaß) wrote:
I would also opt for copy semantics whenever = is used for assignment.
But C<$foo[1] = $bar> *does* use copy semantics. The thing on the right
is a reference to a hash, and that reference is copied (by value) into
C<$foo[1]>.
It seems what you're really requesting is for the assignment operator to
auto-dereference references. But if you can't copy references, they
become pretty useless.
=thom