Overloaded Class::DBI packages

Simon Wistow simon at thegestalt.org
Fri Jul 21 10:59:45 BST 2006


I have a bunch of Class::DBI based objects that work just fine. 

	package Foo;

	__PACKAGE__->table('foo');
	__PACKAGE__->columns('id', 'bar');
	# etc etc

	1;


However now I want to have

	package DebugFoo;
	
	use base qw(Foo);
	__PACKAGE__->table('debug_foo');

	1;

where the table overload_view is exactly the same as foo only wiht debug 
info in. 

However that gives me a load of errors along the lines of 

'bar' method already exists. 

and

Can't call method "prepare_cached" on an undefined value at 
/usr/lib/perl5/site_perl/5.8.3/Ima/DBI.pm line 391.

and

Can't use an undefined value as a HASH reference at 
/usr/lib/perl5/site_perl/5.8.3/Class/DBI/Relationship/HasMany.pm line 51

and

Can't locate object method "meta_info" via package 



Any ideas?

Simon




More information about the london.pm mailing list