in reply to Perl: Split/format the output and append it to an array
First, do yourself a big favour and add strictures (use strict; use warnings;) to every script you write.
The answer to both questions is the same: use push.