Here's three options:
In reply to Re: Examples of top command written in Pure PERL by tybalt89 in thread Examples of top command written in Pure PERL by davidfavor