title: Can't locate object method "prepare" via package "DB_CONNECT"
body: <p>I have create package to make a connection with database the code is given below:</p>
  
  <pre><code>#!/usr/bin/perl
  #Class
  package DB_CONNECT;
  #Constructor
          sub new {
                          my ($class)=@_;
                          my $self={};
  
                          $self-&gt;{_odbc}="dbi:ODBC:SQLSERVER";
                          $self-&gt;{_username}="xxx";
                          $self-&gt;{_password}="xxx";
                          $self-&gt;{_dbh}=my $dbh;
                          bless $self, $class;
                          return $self;
                  }
  
  ###Method to open the database connection
          sub db_connect
                  {
                  use DBI;
                  my ($self)=@_;
                  $self-&gt;{_dbh}=DBI-&gt;connect($self-&gt;{_odbc},$self-&gt;{_username},$self-&gt;{_password},{PrintError =&gt; 1}) || die "Database connection not made: $DBI::errstr";
  
                  return 1;
  
                  }
  1;
  </code></pre>
  
  <p>Here a set of Perl code to fetch the data from database.</p>
  
  <pre><code>#!/usr/bin/perl
  #use strict;
  
  use Data::Dumper;
  use Asterisk::AGI;
  use DB_CONNECT;
  #require("/root/DB_CONNECT.pm");
  
  my $agi = new Asterisk::AGI;
  my $db = DB_CONNECT-&gt;new();
  
  my $sql = "EXEC usp_sms_ticket '".$status_data."'";
  my $sth = $db-&gt;prepare($sql);
  $sth-&gt;execute();
  
  $return = $sth-&gt;fetchrow();
  $agi-&gt;set_variable('result',$return);
  print Dumper($return);
  $sth-&gt;finish;
  $db-&gt;disconnect;
  </code></pre>
  
  <p>whenever I'm executing my Perl Program i'm getting following error :</p>
  
  <p>Can't locate object method "prepare" via package "DB_CONNECT" </p>