title: global name 're' is not defined
body: <p>I am new to python and working on a map reduce problem with mincemeat. I am getting the following error while running the mincemeat script.</p>
  
  <pre><code>$python mincemeat.py -p changeme localhost
  error: uncaptured python exception, closing channel &lt;__main__.Client connected at 0x923fdcc&gt; 
  (&lt;type 'exceptions.NameError'&gt;:global name 're' is not defined
   [/usr/lib/python2.7/asyncore.py|read|79]
   [/usr/lib/python2.7/asyncore.py|handle_read_event|438] 
   [/usr/lib/python2.7/asynchat.py|handle_read|140]
   [mincemeat.py|found_terminator|96]
   [mincemeat.py|process_command|194]
   [mincemeat.py|call_mapfn|170]
   [raw1.py|mapfn|43])
  </code></pre>
  
  <p>My code rests in raw1.py script which is given in the above stacktrace  as <code>[raw1.py|mapfn|43]</code>.</p>
  
  <pre><code>import re
  import mincemeat
  
  # ...
  
  allStopWords = {'about':1, 'above':1, 'after':1, 'again':1}
  
  def mapfn(fname, fcont):
      # ...
      for item in tList[1].split():
          word = re.sub(r'[^\w]', ' ', item).lower().strip()        # ERROR
          if (word not in allStopWords) and (len(word) &gt; 1):
              # ....
  </code></pre>
  
  <p>I have already imported <code>re</code> in raw1.py. The error doesn't appear if I import <code>re</code> in mincemeat.py.</p>