exec() works differently in Blender?
Official build of Blender come with the latest of Python (3.4.2 as of Blender 2.73); this means that your code cannot compile/be interpreted since, when moving to version 3.0, Python changed print from a keyword to a function.

Your code should be:

foo = "bar"
exec(foo + " = 'something else'")
print(bar) #Print is now a function; must use function call syntax.