you cannot use 'foo' and 'bar' as indexes of an array. Array indexes are numeric. You can use $foo and $bar if they contain numeric values. That may be your problem.
I wrote the following program to show the proper way of doing this. Paste it into a file named atest.pl, then run it with 'perl ./atest.pl'.
-- file start --
$a1[2][3] = "one";
$a2[2][3] = "two";
$a2[2][3] = $a1[2][3];
print $a1[2][3], "\n";
print $a2[2][3], "\n";
-- file end --
The output will be:
one
one
lines 1 & 2 initialize two different arrays, each containing a reference to another array (an array of an array).
Line 3 modifies the second array, without changing the first.
The last 2 lines print the contents.
A better way to write it out if you're having trouble understanding it is as follows
It's easy to read it from right to left as follows:
the third element of an array referenced by the second element of the array named a1. So when reading from right to left, just replace the arraow with the words "referenced by".
Hope that makes some sense to you. If you need more specific help, try pasting a few lines of actual code, and actual output that we can work with.