in reply to pushing arrays gives unexpected result

In your code,
@out = push (@out, @newin);
In your particular example, push (@out, @newin) returns number of elements pushed into @out, which is 1, and then you assign @out = 1;, which is effectively @out = (1). You should remove the @out= part to make it work as expected:
push @out, @newin;