note
bart
I am sorry to say that "anonymous array" is actually a misnomer. It's not an array, it's a reference to an array.
<p>These two snippets are actually equivalent:
<code>
my $r = ['a', 'b', 'c'];
</code>
and
<code>
my $r;
{
my @a = ('a', 'b', 'c');
$r = \@a;
}
</code>
<p>So when you try using <c>\[1]</c> to get a reference to the anonymous array, you're ending up with a reference to an array reference.
<p>Drop the backslashes n front of the open square brackets: you don't need them. And start to work it out from there.
11115386
11115386