my $location = $table[i]->[0]; # missing $ on i my $room = $table[i]->[1];