Calling module and function form external file

I have a main.jl as below
include(“hello.jl”)
import hello
hello.foo()

and hello.jl is as below
module hello
function foo()
println(“hello”)
end
end

if I run main.jl, I get an error that package hello not found in the current path. Both main.jl and hello.jl are saved on the same path.

Try:

import .hello

1 Like