I'm not sure whether your main issue is
print isn't adding spaces when you print a list, or that what you really want to do is push onto an array a string consisting of another list joined with spaces. If the latter,
Mugatu is right. If the former, then you can do either
push @out, reverse @array;
print join " ", @out;
or
push @out, reverse @array;
{
local $, = " ";
print @out;
}
Update: forgot the reverse