summaryrefslogtreecommitdiff
path: root/lib/flush.pl
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-08-08 17:01:53 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-08-08 17:01:53 +0000
commit154e51a4a1b0258759b5e901183403af515a35b9 (patch)
treede56925bf09e2d98ed44c60b3386d09cd675be3d /lib/flush.pl
parentff8e2863486f651339834bc9e3e0bd49d61ff4e1 (diff)
downloadperl-154e51a4a1b0258759b5e901183403af515a35b9.tar.gz
perl 3.0 patch #22 patch #19, continued
See patch #19.
Diffstat (limited to 'lib/flush.pl')
-rw-r--r--lib/flush.pl22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/flush.pl b/lib/flush.pl
new file mode 100644
index 0000000000..1d22819ab8
--- /dev/null
+++ b/lib/flush.pl
@@ -0,0 +1,22 @@
+;# 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);
+}
+