File: out_err_mix

package info (click to toggle)
libtest-harness-perl 3.52-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,764 kB
  • sloc: perl: 18,954; sh: 18; makefile: 7
file content (13 lines) | stat: -rw-r--r-- 231 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
sub _autoflush {
    my $flushed = shift;
    my $old_fh  = select $flushed;
    $| = 1;
    select $old_fh;
}

_autoflush( \*STDOUT );
_autoflush( \*STDERR );

print STDOUT "one\n";
print STDERR "two\n\n";
print STDOUT "three\n";