<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1555" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial>
<P><FONT color=#0000ff size=2>I have DBIx::Class working using mysql<SPAN
class=149124506-24082006> on win32 </SPAN>. Here's my code<SPAN
class=149124506-24082006> which is just designed to test the concept using
a single table in my DB</SPAN>:</FONT></P><PRE class=code><DIV class=codeblock><TT class=codetext><FONT color=#0000ff><FONT size=2><FONT color=#800000># set up a schema class using 2 modules that I've written manually
use MG::Schema::Tables; # *
use MG::Schema::Country; # *
my $schema = MG::Schema->connect('DBI:mysql:mg', 'jfrm', '???'); #*
# 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 = MG::Main->connect('DBI:mysql:mg', 'jfrm', '????'); #&
# Query for all countries and<SPAN class=149124506-24082006><FONT face=Arial color=#0000ff> </FONT></SPAN>put them in an array,
my @all_countries = $schema->resultset('Country')->all;
foreach my $country (@all_countries) {
print "! ".$country->CountryCode." = ".$country->CountryName."<Br>";
}</FONT><SPAN class=149124506-24082006><FONT face=Arial> </FONT></SPAN></FONT></FONT></TT></DIV><DIV class=codeblock><FONT color=#0000ff size=2><TT class=codetext><SPAN class=149124506-24082006></SPAN></TT></FONT> </DIV><DIV class=codeblock><FONT color=#0000ff size=2>So then I want to change to not have to write all the schemas out manually into modules by using the <SPAN class=149124506-24082006><FONT face=Arial> DBIx::Class::</FONT></SPAN>Schema::Loader module. <SPAN class=149124506-24082006><FONT face=Arial> </FONT></SPAN></FONT></DIV><DIV class=codeblock><FONT face=Arial color=#0000ff size=2><SPAN class=149124506-24082006>I just want to load them all into memory automatically.</SPAN></FONT></DIV><DIV class=codeblock><FONT color=#0000ff size=2>So I comment out the 3 lines labelled #* and uncomment the 2 lines with #&. Here's the error:</FONT></DIV></PRE><PRE class=code><DIV class=codeblock><TT class=codetext><FONT color=#0000ff size=2><FONT color=#800000>[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</FONT>
</FONT></TT></DIV></PRE>
<P><FONT color=#0000ff><FONT size=2><SPAN
class=149124506-24082006> </SPAN></FONT></FONT></P>
<P><FONT color=#0000ff><FONT size=2><FONT>Is this because I'm doing something
wrong due to my very poor understanding of object methods? <SPAN
class=149124506-24082006> (in which case your suggestions would be
extremely welcome)</SPAN></FONT></FONT></FONT></P>
<P><FONT><FONT color=#0000ff><FONT size=2><FONT>Or is it a bug in
this <SPAN class=149124506-24082006> SQL::</SPAN>Abstract::Limit
module<SPAN class=149124506-24082006> . </SPAN> (in which case I'll do
my best to put in a bug report if i can work out how<SPAN
class=149124506-24082006> - Do I put it as a bug report for
DBIx::Class::Schema::Loader or
SQL::Abstract::Limit</SPAN>)?<BR></FONT></FONT></FONT></FONT><FONT size=2><SPAN
class=149124506-24082006></SPAN></FONT></P>
<P><FONT size=2>thanks for any advice.</FONT></P></FONT></DIV></BODY></HTML>