[Dbix-class] Use of uninitialized value warning in
DBIx/Class/ResultSet.pm line 2768 (and others)
Daniel Austin
daniel.austin at gmail.com
Tue Aug 25 07:35:28 GMT 2009
[Woops. Sent this to the old list address. Take 2...]
Hi
I recently switched my DBIx::Class modules to using Result Sets. So I
have a MyCompany/Schema/Result directory with a bunch of modules that
inherit from DBIx::Class::ResultSet.
Apart from a few minor issues the regression tests all pass now except
I've started getting thousands of warnings like this:
Use of uninitialized value in concatenation (.) or string at
./lib/perl5/DBIx/Class/ResultSet.pm line 2768.
The variable in question is $alias which comes out of
$self->{attrs}->{alias}.
Changing line 2761 to this:
my $alias =3D $attrs->{alias} || '';
suppresses the warning but not sure if it's correct (all the
DBIx::Class tests seem to still pass).
The first few lines of my classes all look like this:
package MyCompany::Schema::Result::Centre;
use strict;
use warnings;
use base 'DBIx::Class::ResultSet';
__PACKAGE__->load_components("Core");
__PACKAGE__->table("centre");
__PACKAGE__->add_columns( ... );
(I was trying to follow the example in the Catalyst tutorial. I needed
to do it this way in order to use some custom SQL)
Am I doing something wrong in setting up these classes? Or should I
work on a patch that takes care of the case where attrs->alias is not
defined?
Thanks
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20090825/d31=
fd14b/attachment-0001.htm
More information about the DBIx-Class
mailing list