Or even simpler, just set autoflush to 1 globally at the beginning of your perl script, like this:

$|++;
_________________________
_____________ James Mancini