title: Why do I get the error-message "Undefined subroutine" when calling a function from a module?
body: <p>I have a module named <code>Helpers.pm</code>:</p>
  
  <pre><code>use warnings;
  use 5.012;
  
  package Helpers;
  use Exporter qw(import);
  our @EXPORT_OK = qw(my_function);
  
  sub my_function {
      return { one =&gt; 1, two =&gt; 2 };
  }
  
  1;
  </code></pre>
  
  <p>an call it in the script:</p>
  
  <pre><code>#!/usr/bin/env perl
  use warnings;
  use 5.012;
  use Data::Dumper;
  use FindBin qw($RealBin);
  
  use lib $RealBin;
  use Helpers qw(my_function);
  
  my $ref = my_function();
  say Dumper $ref;
  </code></pre>
  
  <p>and I get no error-messages.
  But when I put the module in the directory <code>TestDir</code> an modify the script like this:</p>
  
  <pre><code>#!/usr/bin/env perl
  use warnings;
  use 5.012;
  use Data::Dumper;
  use FindBin qw($RealBin);
  
  use lib $RealBin;
  use TestDir::Helpers qw(my_function);
  
  my $ref = my_function();
  say Dumper $ref;
  </code></pre>
  
  <p>I get this error-message:</p>
  
  <pre><code>Undefined subroutine &amp;main::my_function called at ./perl.pl line 10.
  </code></pre>
  
  <p>Why do I get this error-message?</p>