subclassing autoloaded Class::DBI::Loader classes?
[prev]
[thread]
[next]
[Date index for 2004/12/17]
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
|
|
subclassing autoloaded Class::DBI::Loader classes?
Drew Wilson 16:06 on 17 Dec 2004
|