sub flush { my $fh = shift; my $old_fh = select $fh; local $|++; print $fh q{}; select $old_fh; return 1; }