$ cat file_gen.pl #!/usr/bin/env perl use strict; use warnings; open my $FH, '>', 'a_file.txt'; $|=1; for (1 .. 1000) { print $FH "$_: here's 80 stars: ", "*"x80, "\n"; my $t = time; print "$t: line: $_\n"; sleep 1; } #### #!/usr/bin/env perl use strict; use warnings; while (1) { my $t = time; print "$t: Here's what we have so far:\n"; open my $FH, '<', 'a_file.txt'; my @lines = <$FH>; close $FH; print join("", @lines),"\n"; sleep 5; }