mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
23 lines
368 B
Perl
23 lines
368 B
Perl
;# Usage: &flush(FILEHANDLE)
|
|
;# flushes the named filehandle
|
|
|
|
;# Usage: &printflush(FILEHANDLE, "prompt: ")
|
|
;# prints arguments and flushes filehandle
|
|
|
|
sub flush {
|
|
local($old) = select(shift);
|
|
$| = 1;
|
|
print "";
|
|
$| = 0;
|
|
select($old);
|
|
}
|
|
|
|
sub printflush {
|
|
local($old) = select(shift);
|
|
$| = 1;
|
|
print @_;
|
|
$| = 0;
|
|
select($old);
|
|
}
|
|
|
|
1;
|