Calling module and function form external file

#1

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.

0 Likes

#2

Try:

import .hello

1 Like