Maybe you should not ignore strict and the other things. You might have got some indication on your mistakes (although I can't check that now, having no environment right now).
[1,2,3] is not an array but a reference to an array. So you may want
my $a = [1, 2, 3];
or
my @a = (1, 2, 3);
This also does not work:
foreach $a[1](@b)
Maybe you want something this:
foreach @$a[1][@b]
but I am really not sure, because the inner array has not been initialized. Finally,
$a[1]
is also probably wrong, since @a is a reference to an array. Please explain what you are really trying to do, I can't really figure out.