diff --git a/preprocessor/ModFile.cc b/preprocessor/ModFile.cc
index 3e70440f720c8aa0cb15275d3d093ba6f1033bd9..b1a747c97d5788e7cbfbdf787a2bcd3b4063f3eb 100644
--- a/preprocessor/ModFile.cc
+++ b/preprocessor/ModFile.cc
@@ -443,11 +443,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