subclassing autoloaded Class::DBI::Loader classes?

[prev] [thread] [next] [Date index for 2004/12/17]

From: Drew Wilson
Subject: subclassing autoloaded Class::DBI::Loader classes?
Date: 16:06 on 17 Dec 2004
I'm having troubles implementing a subclass of a DBI class autoloaded 
with Class::DBI::Loader.

The error I get is:
syntax error at Language.pm line 3, near "use 'DBI::Language'"
Compilation failed in require at t.pl line 16.
BEGIN failed--compilation aborted at t.pl line 16.

Any suggestions on how to do this?

The error message above occurs when I run my program t.pl using local 
package Language.pm.

Where Language.pm contains:
package Language;

use 'DBI::Language';
use base 'DBI::Language';

1;


and my t.pl contains:
#!/usr/bin/perl -w

use Class::DBI::Loader;
use Data::Dumper;

my $loader = Class::DBI::Loader->new(
   dsn                     => "dbi:Pg:dbname=TransMatch;host=127.0.0.1",
   user                    => "postgres",
   password                => "",
   namespace               => "DBI"
   relationships           => 1
);

use Language;

my @languages = Language->retrieve_all();
print Dumper(@languages);

foreach (@languages) {
   print $_->name . "\n";
}

Many thanks,

Drew

Class::DBI::Loader 0.10 (with automatic relationships!)
Sebastian Riedel 03:40 on 15 Dec 2004

subclassing autoloaded Class::DBI::Loader classes?
Drew Wilson 16:06 on 17 Dec 2004

Generated at 09:04 on 20 Dec 2004 by mariachi v0.52