in reply to pause output when printing an array to the screen

Pipe the output into a terminal pager, e.g.:

perl theprogram | less

Trying to reinvent that particular wheel in Perl is not a thing I care about much.