in reply to Working Through An Array In Chunks
Rather than accumulating all your data in an array and then outputting it in arbitrary sized chunks regardless of the user terminal size. Which also means the user has to wait until you've produced it all, before seeing any of it. You could use something like
perl -wle" open OUT, '| more'; print OUT $_ for 1 .. 1000"
Ie. Open a handle to the system/user more program and then just print the data as you produce it and let the system utility take care of the paging. This has the added value of giving the user access to all the system utility's facilities, like backing up, search etc.
|
|---|