diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 82209665c8e06d97ce880b15c6ca0ff41c061ae2..f6b409bd1eeede523d69437911534ed51f316421 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -385,11 +385,9 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool console,
 
   if (clear_all)
     {
-      mOutputFile << "if exist('OCTAVE_VERSION')" << endl
-		  << "  clear -all" << endl
-		  << "else" << endl 
-		  << "  clear all" << endl
-		  << "end" << endl;
+      mOutputFile << "clear all" << endl
+	// this is a work-around for a bug in Octave 3.2
+		  << "clear globals" << endl;
     }
 
   mOutputFile << "tic;" << endl