home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / M / MacPerl 4.13 source.sit / Perl Source ƒ / MacPerl / lib / flush.pl < prev    next >
Encoding:
Text File  |  1993-10-23  |  368 b   |  24 lines  |  [TEXT/MPS ]

  1. ;# Usage: &flush(FILEHANDLE)
  2. ;# flushes the named filehandle
  3.  
  4. ;# Usage: &printflush(FILEHANDLE, "prompt: ")
  5. ;# prints arguments and flushes filehandle
  6.  
  7. sub flush {
  8.     local($old) = select(shift);
  9.     $| = 1;
  10.     print "";
  11.     $| = 0;
  12.     select($old);
  13. }
  14.  
  15. sub printflush {
  16.     local($old) = select(shift);
  17.     $| = 1;
  18.     print @_;
  19.     $| = 0;
  20.     select($old);
  21. }
  22.  
  23. 1;
  24.