Calling module name using string variable


I would like to specify by string, which module should be used. Something like i have a file foo.jl

module foo
  something = 1.0

and in the another file (e. g. the_main_file.jl)

module_name = "foo"


The include part is ok, but I am not able to call the module using string. Please, do you have any suggestion? Thanks!

This at most creates a new empty module. Use eval.

OTOH, note that you can easily create multiple unrelated copy of the same module this way depending on what you are doing.

Thanks a lot! It works.