in reply to Rusty?

I couldn't see anything on Mac OS X 10.3.5 in Terminal.app until I set $|=1;. Even on a terminal output is line buffered by default and it looks like you aren't printing any "\n"s. Update: the system 'clear' call does flush the output buffer...just before it clears the screen!

However, I get a smoother display if I just add local $|=1;print to the end of p() rather than setting $|=1 globally and leaving it that way.

Update: At first I tried adding system 'true' to the end of p(), which also works on Mac OS X. However, perlport says it's not portable to SunOS/Solaris and HP-UX.