[Catalyst] Problem flattening arrays in
Catalyst/Helper/Model/DBIC/Schema
pablo marin-garcia
harpactocrates at googlemail.com
Tue Aug 25 23:58:41 GMT 2009
Hello,
Problem:
Can't call method "flatten" on unblessed reference at
/nfs/local_perl/perllib/Catalyst/Helper/Model/DBIC/Schema.pm line 165.
Preamble:
I was following the catalyst tutorial in a Debian etch, and when tried
in tutorial_03 Create Static DBIx::Class Schema Files I had an error
with method "flatten"
$ script/myapp_create.pl model DB DBIC::Schema MyApp::Schema
create=static dbi:SQLite:myapp.db
exists "/nfs/team108/pg4/webserver/catalyst/mytut/MyApp/script/../lib/MyApp/Model"
exists "/nfs/team108/pg4/webserver/catalyst/mytut/MyApp/script/../t"
Can't call method "flatten" on unblessed reference at
/nfs/users/nfs_p/pg4/local_perl/perllib/Catalyst/Helper/Model/DBIC/Schema.pm
line 165.
I installed Catalyst in a macbook and this works OK. So seems that I
have a broken Moose module somewhere but I don't know how to find it.
Exploring:
The offending line:
"my @args = $self->args->flatten if $self->args;"
if I unflatten the args with @{$self->args} the script works. It seems
that Moose is giving args a constrain isa=>ArrayRef but somewhere the
call to flatten (Moose::Autobox) is not properly handle.
I have no experience with Moose, and being the code metaprogramed is a
bit difficult follow the process with the debugger.
I would like to find out where I have the bad installed/missed module
(I assume that is part of Moose or Moose-catalyst). Could someone
point me in any interesting direction or how to keep in the search? I
have spent a day learning how Moose works but I run off ideas to fix
the issue.
Regards
PS: debugging oddity: in my macbook the scripts works ok but under the
debugger if the offending line
my @args = $self->args->flatten if $self->args;
is run n by n it goes ok but if I evaluate with "x
$self->args->flatten" I have the same error than in my linux
installation about calling flatten in unblessed ref.
--
- Pablo Marin-Garcia
--
- Pablo Marin-Garcia
More information about the Catalyst
mailing list