pankaj_it09 has asked for the wisdom of the Perl Monks concerning the following question:

I ran the below code -->
package Database; use base 'DBIx::ActiveRecord::Model'; DBIx::ActiveRecord::Model->table('sca_lt'); # table name is required DBIx::ActiveRecord::Model->columns(qw/pid fp fn/); # required DBIx::ActiveRecord::Model->primary_keys(qw/pid/); # required my $data_source = 'dbi:SQLite:sca_lt'; my $username = 'user'; my $auth = 'pwd'; DBIx::ActiveRecord->connect($data_source, $username, $auth, \%attr); my $m = Database->new(); my $list = $m->all; print $list;

Error message is as below -->

Can't call method "instantiates_by_relation" on an undefined value at at I:/Perl/site/lib/DBIx/ActiveRecord/Scope.pm line 88.

Replies are listed 'Best First'.
Re: DBIx::ActiveRecord usage
by choroba (Cardinal) on May 19, 2014 at 16:06 UTC
    What is the question? Which line triggers the error?
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      How to use DBIx::ActiveRecord ?

      The line no is already given.
        I mean the line in your code.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ