title: Calling imported module functions directly in elixir
body: <p>I have just started learning Elixir and I am unable to figure out how import works in Elixir.
  When I import a module into another module using <code>import</code> I am unable to call the imported function by using the module in which it is imported.</p>
  
  <p>But I am able to call function of imported module inside function in the module which it was imported.</p>
  
  <pre><code>defmodule A do
    def func do
     IO.puts("func called")
    end
  end
  
  defmodule B do
    import A
  end
  
  A.func # o/p: "func called"
  B.func # (UndefinedFunctionError) undefined function: B.func/0
  
  defmodule B do
    import A
  
    def func2 do
      func
    end
  end
  
  B.func2 # o/p "func called"
  </code></pre>
  
  <p>I am unable to figure out why B.func not works while I was able to call <code>func</code> from <code>func2</code>. Is there some kind of theory that I am missing. Coming from the Ruby background this behaviour looks odd to me. Please can anybody help me out or point me to some good resource to read.</p>