File Coverage

blib/lib/flush.pl
Criterion Covered Total %
statement 3 13 23.0
branch n/a
condition n/a
subroutine 1 3 33.3
pod n/a
total 4 16 25.0


line stmt bran cond sub pod time code
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             #
5             # In particular, this should not be used as an example of modern Perl
6             # programming techniques.
7             #
8             # Suggested alternative: IO::Handle
9             #
10             ;# Usage: &flush(FILEHANDLE)
11             ;# flushes the named filehandle
12              
13             ;# Usage: &printflush(FILEHANDLE, "prompt: ")
14             ;# prints arguments and flushes filehandle
15              
16 1     1   1098 no warnings "ambiguous";
  1         3  
  1         130  
17              
18             sub flush {
19 0     0     local($old) = select(shift);
20 0           $| = 1;
21 0           print "";
22 0           $| = 0;
23 0           select($old);
24             }
25              
26             sub printflush {
27 0     0     local($old) = select(shift);
28 0           $| = 1;
29 0           print @_;
30 0           $| = 0;
31 0           select($old);
32             }
33              
34             1;