#!/usr/bin/env perl use warnings; use 5.010; use Time::HiRes qw(sleep); use Curses; initscr(); noecho(); cbreak(); nodelay( 1 ); sub done { endwin(); say "@_"; exit; } sub my_print { my @data = `ps aux 2>&1`; for my $i ( 0 .. $LINES - 1 ) { addstr( $i, 0, $data[$i] || ' ' x $COLS ); sleep 0.1; refresh(); } } my $timeout = 2; my_print(); while ( 1 ) { select( undef, undef, undef, $timeout ); my_print(); }