doc f7abe7
[p5sagit/p5-mst-13.2.git] / lib / flush.pl
1 #
2 # This library is no longer being maintained, and is included for backward
3 # compatibility with Perl 4 programs which may require it.
4 # This legacy library is deprecated and will be removed in a future
5 # release of perl.
6 #
7 # In particular, this should not be used as an example of modern Perl
8 # programming techniques.
9 #
10 # Suggested alternative: IO::Handle
11
12 ;# Usage: &flush(FILEHANDLE)
13 ;# flushes the named filehandle
14
15 ;# Usage: &printflush(FILEHANDLE, "prompt: ")
16 ;# prints arguments and flushes filehandle
17
18 sub flush {
19     local($old) = select(shift);
20     $| = 1;
21     print "";
22     $| = 0;
23     select($old);
24 }
25
26 sub printflush {
27     local($old) = select(shift);
28     $| = 1;
29     print @_;
30     $| = 0;
31     select($old);
32 }
33
34 1;