[Dbix-class] Problem with DBIx::Class::Schema::Loader or

James Masters james at masters.me.uk
Thu Aug 24 08:52:59 CEST 2006


I have DBIx::Class working using mysql on win32 . Here's my code  which is
just designed to test the concept using a single table in my DB:

# set up a schema class using 2 modules that I've written manually
use MG::Schema::Tables;   # *
use MG::Schema::Country;  # *
my $schema 
# Or better, fill the class with table info automatically (using a file
called MG/Main.pm with content:
#package MG::Main;
#use base qw/DBIx::Class::Schema::Loader/;
#__PACKAGE__->loader_options(
#    relationships           => 1);

#use MG::Main;    #&
#my $schema 
# Query for all countries and put them in an array,
my @all_countries foreach my $country (@all_countries) {
    print "! ".$country->CountryCode."     } So then I want to change to not have to write all the schemas out
manually into modules by using the  DBIx::Class::Schema::Loader module.  I
just want to load them all into memory automatically.So I comment out the 3
lines labelled #* and uncomment the 2 lines with #&. Here's the error:[Wed
Aug 23 18:22:49 2006] mgdb.pl: Attempt to free unreferenced scalar: SV
0x1fa7a5c, Perl interpreter: 0x224234 at
C:/Perl/site/lib/SQL/Abstract/Limit.pm line 325.
[Wed Aug 23 18:22:49 2006] mgdb.pl:  at
C:/Perl/site/lib/SQL/Abstract/Limit.pm line 325
Software error:
Can't locate object method "CountryCode" via package "MG::Main::Country" at
C:/Information/mgroot/cgi-bin/mgdb.pl line 53.
 at C:/Information/mgroot/cgi-bin/mgdb.pl line 53


Is this because I'm doing something wrong due to my very poor understanding
of object methods?  (in which case your suggestions would be extremely
welcome)

Or is it a bug in this  SQL::Abstract::Limit module .  (in which case I'll
do my best to put in a bug report if i can work out how  - Do I put it as a
bug report for DBIx::Class::Schema::Loader or SQL::Abstract::Limit)?


thanks for any advice.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rawmode.org/pipermail/dbix-class/attachments/20060824/56ad6587/attachment.htm 


More information about the Dbix-class mailing list