From 486ed70d1cbb42cb953a9cfaefdb242f2fe87fe3 Mon Sep 17 00:00:00 2001 From: Robert Patten Date: Thu, 7 Sep 2017 22:10:38 -0600 Subject: [PATCH] flush.pl added PerlMUD will not work without this file! Was not included on either the GitHub repo or the tar file on https://boutell.com/perlmud/. --- flush.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 flush.pl diff --git a/flush.pl b/flush.pl new file mode 100644 index 0000000..6f07a46 --- /dev/null +++ b/flush.pl @@ -0,0 +1,32 @@ +# +# This library is no longer being maintained, and is included for backward +# compatibility with Perl 4 programs which may require it. +# +# In particular, this should not be used as an example of modern Perl +# programming techniques. +# +# Suggested alternative: IO::Handle +# +;# Usage: &flush(FILEHANDLE) +;# flushes the named filehandle + +;# Usage: &printflush(FILEHANDLE, "prompt: ") +;# prints arguments and flushes filehandle + +sub flush { + local($old) = select(shift); + $| = 1; + print ""; + $| = 0; + select($old); +} + +sub printflush { + local($old) = select(shift); + $| = 1; + print @_; + $| = 0; + select($old); +} + +1; \ No newline at end of file