Actually that's not true. The line $trainset[scalar(@trainset)] = \@inputs; will increase the side of the @trainset array so that when $trainset[scalar(@trainset)] = \@outputs; is called, scalar(@trainset) will be one larger and therefore not overwrite the original data. This is akin to a push.
You statment is true. However, I'd like to ask why you are not simply using push? Does this method offer some benifit that I do not see? If so, please enlighten me.
A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you