Calling module name using string variable

Hello,

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
end

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

module_name = "foo"

include("$(module_name).jl")
Module(Symbol(module_name)).something

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.