http://www.perlmonks.org?node_id=305803


in reply to Handling program output in real time

You need to set $| = 1; in "blackbox.pl".