in reply to reading input into a number of arrays

As for why the original code did what it did:

It looks like Perl parsed the comma-delimited list of subscripts as a Perl list, which it then evaluated in scalar context to get the subscript. When a list is evaluated in scalar context it yields its last element. So $a[$i,1] was seen as $a[1].

All of this would probably have puzzled you much less if you had started your script with

use strict; use warnings;