title: Error: "Can't locate object method "new" via package" in Perl
body: <p>I'm new to Perl, so I'm having some problems with OOP.</p>
  
  <p>I have...</p>
  
  <ul>
  <li>connect4.pl</li>
  <li>Player.pm</li>
  </ul>
  
  <p>I'm trying to use module "Player" in connect4,pl, but I get the error: "Can't locate object method "new" via package" when I try to create an instance of the module.</p>
  
  <p>I've read other posts, but I don't quite get what their problem was and how it was fixed...</p>
  
  <p>Here is a snippets (I have deleted many lines, I just included what I thought was important)</p>
  
  <pre><code>use Player;
  
  my $temp_connect_four = Player -&gt; new("parameters");
  </code></pre>
  
  <p>and</p>
  
  <pre><code>package connect4;
  
  sub new{
  #some variables
  }
  
  #more methods/subroutines
  </code></pre>
  
  <p>What's the problem?</p>