ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/staticperl/perl/lib/flush.pl
Revision: 1.1
Committed: Thu Jun 30 14:27:09 2005 UTC (21 years, 3 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: PERL-5-8-7, HEAD
Branch point for: PERL
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.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     sub flush {
17     local($old) = select(shift);
18     $| = 1;
19     print "";
20     $| = 0;
21     select($old);
22     }
23    
24     sub printflush {
25     local($old) = select(shift);
26     $| = 1;
27     print @_;
28     $| = 0;
29     select($old);
30     }
31    
32     1;