my $n = 1; while( $n < 5 ) { # capture a single screen's worth of output... my $temp = `top -b -n 1`; # process $temp here... # play nice sleep 15; $n = $n + 1; }