use strict; use warnings; open my $fh, '>'. "testingwrite" or die; my $count = 20; while ($count--) { print $fh "count = $count\n"; sleep (5); }