use strict; use warnings; open(my $fh, '>:unix', "test.txt") or die "test.txt: $!"; foreach my $i (1..20) { print $fh "iteration $i\n"; sleep(5); } close($fh); #### use strict; use warnings; use PerlIO; print join(', ', PerlIO::get_layers(*STDOUT)) . "\n"; binmode(*STDOUT, ":pop"); print join(', ', PerlIO::get_layers(*STDOUT)) . "\n"; __END__ unix, perlio unix