in reply to Re^2: Memcached and arrays?
in thread Memcached and arrays?
I thought subroutines can accept arrays then passed to @_
That sentence is a contradiction. Array element can only be scalars, so @_ can't contain an array. It can only contain a reference to one since a reference is a scalar.
In
foo(@a)
@a evaluates to its content, and those are used as the arguments. The above is the same as
foo($a[0], $a[1], $a[2], $a[3]);
The plan was to use this code segment once working in a larger context.
Careful
my $old_x = [qw( a b c )]; $memd->set(x => $x); my $new_x = mem_get('x'); # $new_x = 3 !?
|
|---|