Commit | Line | Data |
---|---|---|
a6d71656 GS |
1 | # |
2 | # This library is no longer being maintained, and is included for backward | |
3 | # compatibility with Perl 4 programs which may require it. | |
b2f4098f S |
4 | # This legacy library is deprecated and will be removed in a future |
5 | # release of perl. | |
a6d71656 GS |
6 | # |
7 | # In particular, this should not be used as an example of modern Perl | |
8 | # programming techniques. | |
9 | # | |
10 | # Suggested alternative: IO::Handle | |
b2f4098f S |
11 | |
12 | warn( "The 'flush.pl' legacy library is deprecated and will be" | |
13 | . " removed in the next major release of perl. Please use the" | |
14 | . " IO::Handle module instead." ); | |
15 | ||
154e51a4 LW |
16 | ;# Usage: &flush(FILEHANDLE) |
17 | ;# flushes the named filehandle | |
18 | ||
19 | ;# Usage: &printflush(FILEHANDLE, "prompt: ") | |
20 | ;# prints arguments and flushes filehandle | |
21 | ||
22 | sub flush { | |
23 | local($old) = select(shift); | |
24 | $| = 1; | |
25 | print ""; | |
26 | $| = 0; | |
27 | select($old); | |
28 | } | |
29 | ||
30 | sub printflush { | |
31 | local($old) = select(shift); | |
32 | $| = 1; | |
33 | print @_; | |
34 | $| = 0; | |
35 | select($old); | |
36 | } | |
37 | ||
c623bd54 | 38 | 1; |